Giter Site home page Giter Site logo

mh-ssg's People

Contributors

lyu4321 avatar minhhang107 avatar mqnguyen5 avatar tuanthanh2067 avatar

Stargazers

 avatar

Watchers

 avatar

mh-ssg's Issues

Improve your SSG by adding support for markdown files

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!

Mistake in the optional feature: Parsing title

If there is a title, it will be the first line followed by two blank lines. However, the program will set the whole paragraph as the title if there are no two blank lines.

orignal txt file
image

generated html file

image

Add Tests for processFolder

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

  • When the input directory has files
  • When the input directory does not exist

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.

Add support for static assets

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:

  • add full markdown support (currently the tool is not parsing image tag from markdown to html)
  • create an assets folder inside the output folder
  • save all static files from user input to assets folder
  • parse the saved assets to the html file

Add new features: Support —config with Config file

Hi Hang, I would like to contribute to the tool by adding support for config files. The details for the feature will be the following:

  • Add new -c or —config flag thay specifies a path to a JSON config file
  • If the file is missing or can’t be parsed as JSON, exit the program with appropriate error mesage
  • Ignore all other command-line options when accepting —config
  • In the config file, ignore any options that the tool doesn’t recognize
  • In the config file, use the default values for unspecified/missing options

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.

Simplify validateOutputFolder for dist and non-dist

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.

Add support for inline <code> in Markdown

For .md file input, find text enclosed within single backticks and convert the backticks into correct HTML tags. The following needs to be done:

  • Convert single backticks into <code>...</code>
  • Update documentations

Code Review

The tool works perfectly, all features were applied properly, the source code is neat and easy to understand. However, the data contained in generated HTML files is displayed a little messy.
image

Add support for a horizontal rule in Markdown

For .md file input, find all the horizontal rules and convert them into the correct HTML tags. The following needs to be done:

  • Find and convert --- in Markdown file into <hr>
  • Update documentations

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.