You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it could be a rly great addition if people dont have to look for hosting
But instead can upload a file which is processed in js
Chatgpt says it works like this
With <input type="file" id="mdFile" accept=".md" />
// Get the file input and content display elementsconstfileInput=document.getElementById('mdFile');constfileContentDisplay=document.getElementById('fileContent');// Listen for file input changes (file upload)fileInput.addEventListener('change',(event)=>{constfile=event.target.files[0];// Get the first file// Ensure the file is a markdown fileif(file&&file.type===""){// Create a FileReader to read the file contentconstreader=newFileReader();// Define what happens when the file is readreader.onload=function(e){constfileContent=e.target.result;// File content as textdisplayMarkdown(fileContent);// Call function to display the content};// Read the file as textreader.readAsText(file);}else{alert('Please upload a valid markdown (.md) file');}});// Function to display markdown content in the pagefunctiondisplayMarkdown(content){// Display the raw markdown text (you could parse this for richer rendering)fileContentDisplay.textContent=content;// Optionally: If you want to render Markdown to HTML using a library like marked.js:// const htmlContent = marked(content);// fileContentDisplay.innerHTML = htmlContent;}
then just pass the markdown to the beforeEach hook
For this type of advanced functionality, I would suggest you make your own instance of Docsify-This (which is intended to serve as a entry point to Markdown publishing) right on GitHub and then try out this technique and if successful use that same instance to provide that functionality.
I think it could be a rly great addition if people dont have to look for hosting
But instead can upload a file which is processed in js
Chatgpt says it works like this
With
<input type="file" id="mdFile" accept=".md" />
then just pass the markdown to the
beforeEach
hookhttps://github.com/docsifyjs/docsify/blob/develop/docs/write-a-plugin.md#beforeeach
The text was updated successfully, but these errors were encountered: