gen api reference beginning

This commit is contained in:
janis
2023-01-25 12:47:13 +01:00
parent bb84b3a1a4
commit fa74800cc0
3 changed files with 18 additions and 10 deletions

View File

@@ -15,8 +15,8 @@
<div id="docPage"> <div id="docPage">
<div id="doc-container"> <div id="doc-container">
<h1>API reference</h1> <h1>API reference</h1>
<p>impress.js is a JavaScript framework to create stunning presentations. Note: impress may not help you, if you have nothing interesting to say!</p> <p>Are you looking for more detailed documentation? Here you can see all the API reference</p>
<p>If you are new to impress and you want to learn to use it, we suggest you <a href="./gettingStarted.html" class="docs-link">start here</a>!</p> <p>If you are new to impress and you want to learn to use it, we suggest you <a href="/docs/gettingStarted.html" class="docs-link">start here</a>!</p>
</div> </div>
</div> </div>
<div id="footer"></div> <div id="footer"></div>

View File

@@ -26,7 +26,7 @@ delete plugins[0];
for ( let item in plugins ) { for ( let item in plugins ) {
fs.readFile( path.join( pluginsPath + '/' + plugins[item] + '/README.md' ), ( error, data ) => { fs.readFile( path.join( pluginsPath + '/' + plugins[item] + '/README.md' ), ( error, data ) => {
if ( error ) { 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 { } else {
let html = md2html.render( '' + data ); let html = md2html.render( '' + data );
storeHTML( findLinks( html, path.join( pluginsPath + '/' + plugins[item] ) ), plugins[item] ); storeHTML( findLinks( html, path.join( pluginsPath + '/' + plugins[item] ) ), plugins[item] );
@@ -35,14 +35,10 @@ for ( let item in plugins ) {
} }
generateNav (); generateNav ();
parseDocumentationMD();
storeHTML( md2html.render( '' + fs.readFileSync( path.join( __dirname + '/../../../GettingStarted.md' ) ) ), path.join( __dirname + '/../gettingStarted.html' ) ); 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 ) { function findLinks ( html, path ) {
let returnHTML = html; let returnHTML = html;
for ( let letter in html ) { for ( let letter in html ) {
@@ -173,3 +169,15 @@ function generateNav () {
</html>`; </html>`;
fs.writeFileSync( docRoot + '/nav.html', fileStruct ); fs.writeFileSync( docRoot + '/nav.html', fileStruct );
}; };
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 );
};
};
};
}

View File

@@ -5,7 +5,7 @@
<!--I am using jquery for button animations.--> <!--I am using jquery for button animations.-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/jquery-ui.min.js" crossorigin="anonymous" referrerpolicy="no-referrer"></script> <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/jquery-ui.min.js" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/styles/default.min.css"> <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/styles/dark.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/highlight.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/highlight.min.js"></script>
<script>hljs.highlightAll();</script> <script>hljs.highlightAll();</script>
<script src="/js/docs/loader.js"></script> <script src="/js/docs/loader.js"></script>