fix build crash

This commit is contained in:
janis
2023-02-23 15:35:17 +01:00
parent 52c22d839c
commit a0f6ad6fcc
5 changed files with 43 additions and 25 deletions

View File

@@ -56,19 +56,3 @@ filename = 'js/impress.min.js.map';
fs.writeFileSync(filename, result.map); fs.writeFileSync(filename, result.map);
console.log(filename); console.log(filename);
/* Auto generate an index.html that lists all the directories under examples/
* This is useful for gh-pages, so you can link to http://impress.github.io/impress.js/examples
*/
var html_list = '<ul><br />\n'
ls( 'examples/*', { type: 'dir' }).forEach(function(dir) {
html_list += ' <li><a href="' + dir['file'] + '/">' + dir['name'] + '</a></li>\n';
});
html_list += '</ul>\n'
var html = '<html>\n<head>\n<title>Example presentations</title>\n</head>\n<body>'
html += '<h1>Example presentations</h1>\n' + html_list
html += '</body>\n</html>'
filename = path.resolve(__dirname, 'examples', 'index.html');
fs.writeFileSync(filename, html);
console.log(filename);

View File

@@ -171,3 +171,7 @@ body {
width: 40%; width: 40%;
} }
} }
code {
text-align: justify;
}

View File

@@ -4,12 +4,13 @@
</head> </head>
<body><h1>Example presentations</h1> <body><h1>Example presentations</h1>
<ul><br /> <ul><br />
<li><a href="2D-navigation/">2D-navigation</a></li> <li><a href="undefined/">undefined</a></li>
<li><a href="3D-positions/">3D-positions</a></li> <li><a href="undefined/">undefined</a></li>
<li><a href="3D-rotations/">3D-rotations</a></li> <li><a href="undefined/">undefined</a></li>
<li><a href="classic-slides/">classic-slides</a></li> <li><a href="undefined/">undefined</a></li>
<li><a href="cube/">cube</a></li> <li><a href="undefined/">undefined</a></li>
<li><a href="markdown/">markdown</a></li> <li><a href="undefined/">undefined</a></li>
<li><a href="undefined/">undefined</a></li>
</ul> </ul>
</body> </body>
</html> </html>

View File

@@ -17,6 +17,7 @@ const path = require( 'path' );
const mdhtml = require( 'markdown-it' ); const mdhtml = require( 'markdown-it' );
const md2html = new mdhtml(); const md2html = new mdhtml();
const docRoot = path.join( __dirname + '/../' ); const docRoot = path.join( __dirname + '/../' );
const ls = require( 'ls' );
const prompt = require( 'prompt-sync' )( { const prompt = require( 'prompt-sync' )( {
sigint: true sigint: true
} ); } );
@@ -58,6 +59,8 @@ for ( let obj in docPages ) {
console.log( 'regenerating Nav' ); console.log( 'regenerating Nav' );
generateNav (); generateNav ();
buildExamplesPage();
/* /*
This function finds links. The reason for this is possible incompatibilities with links on the website This function finds links. The reason for this is possible incompatibilities with links on the website
*/ */
@@ -265,6 +268,28 @@ function parseDocumentationMD () {
} }
}; };
storeHTML( updatedPage, title, 'reference' ); storeHTML( updatedPage, title, 'reference' );
};
};
} }
function generateGettingStarted () {
} }
function buildExamplesPage () {
/* Auto generate an index.html that lists all the directories under examples/
* This is useful for gh-pages, so you can link to http://impress.github.io/impress.js/examples
*/
var html_list = '<ul><br />\n'
let dirList = fs.readdirSync( path.join( __dirname + '/../../demo/examples' ) )
dirList.forEach( function( dir ) {
html_list += ' <li><a href="' + dir['file'] + '/">' + dir[ 'name' ] + '</a></li>\n';
});
html_list += '</ul>\n'
var html = '<html>\n<head>\n<title>Example presentations</title>\n</head>\n<body>'
html += '<h1>Example presentations</h1>\n' + html_list
html += '</body>\n</html>'
fs.writeFileSync( path.join( __dirname + '/../../demo/examples/index.html' ), html );
} }

View File

@@ -34,7 +34,11 @@
<!--TODO: Add html demo code--> <!--TODO: Add html demo code-->
<pre> <pre>
<code> <code>
&lt;div&gt;&lt;/div&gt; &lt;div id=&quot;impress&quot;&gt;
&lt;div class=&quot;step&quot;&gt;
&lt;h1&gt;impress.js - The JavaScript presentation framework&lt;/h1&gt;
&lt;/div&gt;
&lt;/div&gt;
</code> </code>
</pre> </pre>
</div> </div>