Skip to content
Snippets Groups Projects
Commit fd203d44 authored by Loïc Correnson's avatar Loïc Correnson Committed by Michele Alberti
Browse files

[ivette/doc] icons gallery

parent 0e1d7905
No related branches found
No related tags found
No related merge requests found
...@@ -28,9 +28,13 @@ lint: dome-pkg dome-templ ...@@ -28,9 +28,13 @@ lint: dome-pkg dome-templ
# --- Ivette Documentation # --- Ivette Documentation
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
GUIDES= src/dome/doc/guides
VERSION=$(shell echo "console.log(require('./package.json').version)" | node -) VERSION=$(shell echo "console.log(require('./package.json').version)" | node -)
DOC_ICONS_CSS= src/dome/doc/gallery.css
DOC_ICONS_MAKE= src/dome/doc/iconsmd.js
DOC_ICONS_DATA= src/dome/src/renderer/controls/icons.json
DOC_GUIDES= src/dome/doc/guides
NODEBIN= ./node_modules/.bin NODEBIN= ./node_modules/.bin
doc: $(NODEBIN)/typedoc doc: $(NODEBIN)/typedoc
...@@ -39,7 +43,9 @@ doc: $(NODEBIN)/typedoc ...@@ -39,7 +43,9 @@ doc: $(NODEBIN)/typedoc
@yarn run typedoc @yarn run typedoc
@mkdir -p doc/html/guides @mkdir -p doc/html/guides
@echo "\n[Ivette] guides" @echo "\n[Ivette] guides"
@find $(GUIDES) -name "*.md" -exec cp -f {} doc/html/guides/ \; @node $(DOC_ICONS_MAKE) $(DOC_ICONS_DATA) > doc/html/guides/icons.md
@cp $(DOC_ICONS_CSS) doc/html/assets/css/
@find $(DOC_GUIDES) -name "*.md" -exec cp -f {} doc/html/guides/ \;
@find doc/html/guides -name "*.md" -print -exec pandoc \ @find doc/html/guides -name "*.md" -print -exec pandoc \
--standalone --toc --toc-depth=2 --to html \ --standalone --toc --toc-depth=2 --to html \
--template doc/pandoc/template.html \ --template doc/pandoc/template.html \
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
$endif$ $endif$
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../assets/css/main.css"> <link rel="stylesheet" href="../assets/css/main.css">
<link rel="stylesheet" href="../assets/css/gallery.css">
</head> </head>
<body> <body>
<header> <header>
......
...@@ -25,5 +25,5 @@ The **Dome** framework provides you with the following facilities: ...@@ -25,5 +25,5 @@ The **Dome** framework provides you with the following facilities:
## References ## References
- [Custom Hooks](hooks.md) - [Custom Hooks](hooks.md)
- [Icon Gallery](icons.md) - [Icons Gallery](icons.md)
- [Glossary](glossary.md) - [Glossary](glossary.md)
<!-- Icon Gallery -->
<!-- (Generated) -->
// --------------------------------------------------------------------------
// --- Icons Markdown Gallery Generator
// --------------------------------------------------------------------------
const path = require('path');
const icons = require(path.resolve( process.argv[2] ));
const index = [];
const sections = {};
// --- Indexing & Sectioning -----------------------------------------
for ( var name in icons ) {
const icon = icons[name];
const section = icon.section || "Others" ;
if (section != "Others" && index.indexOf(section) < 0) index.push( section );
var content = sections[section] ;
if (!content) sections[section] = content = [] ;
content.push(name) ;
}
index.sort();
if (sections["Others"]) index.push("Others");
console.log( '---' );
console.log( 'subtitle: Icons Gallery' );
console.log( '---' );
console.log();
// --- Gallery (per section) -----------------------------------------
for ( var s = 0 ; s < index.length ; s++ ) {
const section = index[s] ;
console.log( `## ${section} {#SECTION.${section}}` );
console.log();
console.log( ` <div class="database">` );
const content = sections[section] ;
content.sort();
for( var k = 0 ; k < content.length ; k++ ) {
const name = content[k];
const icon = icons[name];
const title = icon.title || name ;
console.log( `<div class="icon-block" title="${title}">`);
console.log( `<div class="icon-name refname" id="ICON.${name}">${name}</div>` );
console.log( `<svg class="icon-svg" viewBox="${icon.viewBox}">` );
console.log( `<path d="${icon.path}"/>`);
console.log( `</svg>` );
console.log( `</div>` );
}
console.log( `</div>`);
console.log();
}
// -------------------------------------------------------------------
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment