From fa74800cc06a371670f8405f5d295bef613bf716 Mon Sep 17 00:00:00 2001 From: janis Date: Wed, 25 Jan 2023 12:47:13 +0100 Subject: [PATCH] gen api reference beginning --- website/docs/reference/index.html | 4 ++-- website/docs/src/build.js | 22 +++++++++++++++------- website/docs/src/template.html | 2 +- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/website/docs/reference/index.html b/website/docs/reference/index.html index 2de687c..e5ef997 100644 --- a/website/docs/reference/index.html +++ b/website/docs/reference/index.html @@ -15,8 +15,8 @@

API reference

-

impress.js is a JavaScript framework to create stunning presentations. Note: impress may not help you, if you have nothing interesting to say!

-

If you are new to impress and you want to learn to use it, we suggest you start here!

+

Are you looking for more detailed documentation? Here you can see all the API reference

+

If you are new to impress and you want to learn to use it, we suggest you start here!

diff --git a/website/docs/src/build.js b/website/docs/src/build.js index 33ddd4e..1c7f8a2 100644 --- a/website/docs/src/build.js +++ b/website/docs/src/build.js @@ -26,7 +26,7 @@ delete plugins[0]; for ( let item in plugins ) { fs.readFile( path.join( pluginsPath + '/' + plugins[item] + '/README.md' ), ( error, data ) => { if ( error ) { - parseJS( path.join( pluginsPath + '/' + plugins[item] ) ); + console.log( 'NO README found for ' + path.join( pluginsPath + '/' + plugins[item] ) + ' PLEASE MAKE SURE YOU HAVE CREATED A README!' ); } else { let html = md2html.render( '' + data ); storeHTML( findLinks( html, path.join( pluginsPath + '/' + plugins[item] ) ), plugins[item] ); @@ -35,14 +35,10 @@ for ( let item in plugins ) { } generateNav (); +parseDocumentationMD(); storeHTML( md2html.render( '' + fs.readFileSync( path.join( __dirname + '/../../../GettingStarted.md' ) ) ), path.join( __dirname + '/../gettingStarted.html' ) ); -function parseJS ( filepath ) { - console.log( 'no readme found for ' + filepath ); - let jsFiles = fs.readdirSync( filepath ); -} - function findLinks ( html, path ) { let returnHTML = html; for ( let letter in html ) { @@ -172,4 +168,16 @@ function generateNav () { `; fs.writeFileSync( docRoot + '/nav.html', fileStruct ); -}; \ No newline at end of file +}; + + +function parseDocumentationMD () { + let doc = '' + fs.readFileSync( path.join( __dirname + '/../../../DOCUMENTATION.md' ) ); + for ( let letter in doc ) { + if ( doc[letter] == '#' ) { + if ( doc.slice( parseInt( letter ), parseInt( letter ) + 2 ) === '##' ) { + console.log( '## found at ' + letter ); + }; + }; + }; +} \ No newline at end of file diff --git a/website/docs/src/template.html b/website/docs/src/template.html index 9386477..fb26b62 100644 --- a/website/docs/src/template.html +++ b/website/docs/src/template.html @@ -5,7 +5,7 @@ - +