minhhang107 / mh-ssg Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://minhhang107.github.io/mh-ssg/dist/Silver%20Blaze.html
License: MIT License
Home Page: https://minhhang107.github.io/mh-ssg/dist/Silver%20Blaze.html
License: MIT License
Hello Hang, I was looking at your project and something just came to my mind that why don't we add a feature that can handle markdown files.
Because of that feature, I need to add some functions to your code
Modify bin/index.js so that it will accept both txt files and md files
Modify bin/utils/processFile.js so that it can handle markdown files
Modify docs
Let me know how you think of this idea!
Hello, I'd like to create a new test file and add some unit tests for the processFolder function.
In the unit tests, I will be testing for
Please let me know what you think and if I should add any more tests. Thank you!
Edit: Issue updated, will be writing tests for processFolder instead as mentioned in our discussion.
I'm planning to add a new feature that allows users to include static assets like images and stylesheets.
Users must put all assets under a single folder, and they can only use these assets by specifying assets
property in the config json file.
Example:
{
"input": "file.md",
"assets": "./static"
}
Steps to implement:
assets
folder inside the output folderassets
folderHi Hang, I would like to contribute to the tool by adding support for config files. The details for the feature will be the following:
-c
or —config
flag thay specifies a path to a JSON config file—config
Let me know if there is anything I should be aware of when making changes on the code. You can always contact me through Slack if needed.
The code in https://github.com/minhhang107/mh-ssg/blob/main/bin/utils/validateOutputFolder.js is a bit more complicated than it needs to be. Instead of having two separate code paths for dist vs. non-dist folder names, why not treat all names the same way? You have the code already written for the dist case, and you could use any name there.
The fewer special cases you have running through your code, the fewer tests you need to write, and the fewer bugs you'll end up with.
You have some excellent error handling blocks, where you print out an error message for the user, e.g., https://github.com/minhhang107/mh-ssg/blob/main/bin/index.js#L53-L55. You can improve this a bit by having the program exit immediately with a non-zero error code, to indicate a problem:
console.error(
"Input file cannot be blank. Please specify an input file or folder."
);
process.exit(1);
For .md
file input, find text enclosed within single backticks and convert the backticks into correct HTML tags. The following needs to be done:
single backticks
into <code>...</code>
For .md
file input, find all the horizontal rules and convert them into the correct HTML tags. The following needs to be done:
---
in Markdown file into <hr>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.