Git Product home page Git Product logo

sitegen's People

Contributors

abatomunkuev avatar aserputov avatar rc-lee avatar tueenguyen avatar

Watchers

 avatar

sitegen's Issues

Feature: Markdown Admonitions

Continued from #16
Docusaurus' admonitions uses remark-admonitions alongside with MDX.

For SiteGen

  • Take a look at remark admonitions and see if it works without MDX

or

  • Create custom admonitions and styling to be used on SiteGen
  • Plan styles
  • Parse styles
  • Create styling for generated html files

Copy feature for generated code blocks

Many code blocks generated from Markdown have a copy to clipboard feature, like the ones on Docusaurus and the ones here on GitHub.

  • Check if its a bootstrap styling feature for html
  • Have it implemented

Installation problem.

In the process of installing a tool, I have run into a problem. I was going through the "How to use" section. Please, see the picture below.
Screen Shot 2021-09-17 at 4 36 26 PM

It may probably be caused by "-install"

Improve error handling

You have a few approaches to error handling:

  1. console.log() a message
  2. throw and err object

I would improve this a bit. What you do in 1. is good, but would be better done on stderr vs. stdout. Also, I would consider exiting the program with an error code vs. crashing with a stack trace:

if(err) {
  console.error('Helpful error message here...');
  process.exit(-1);
}

New Test.

Hey, @rclee91 I would like to add new tests to your project. Could please assign me ?

Feature: MDX and React Component support

Continued from issue #16

As documented, Docusaurus has built in support for the user to write JSX inside Markdown files, that renders as React components.

A few detailed parts are required

  • Being able to separate the code from regular Markdown
  • Being able to parse the JSX component in Markdown. Docusaurus uses MDX as the parsing engine, so further understanding of how this engine is necessary
  • Being able to run the JSX generated code inside of SiteGen to generate the correct results.
  • Being able to output the correct results from the code and reflected in the same file when called inside the Markdown.

However, as MDX uses React, might have to update SiteGen to use React, or forfeit this feature altogether.

Don't mix streams and direct file operations

You're using a stream to process your file in https://github.com/rclee91/SiteGen/blob/main/bin/index.js#L104-L110. However, you aren't piping that into a write stream. You can pipe one stream into another, and then process things and add it to an existing output file, see https://nodejs.org/en/knowledge/advanced/streams/how-to-use-fs-create-write-stream/.

Also, your stream handling should deal with the error event, and end when the stream is finished.

New SSG feature: adding option --config with Config File

This feature will allow users to specify all of their SSG options in a JSON formatted configuration file instead of having to pass them all as command line arguments every time

It also will:

  • The -c or --config flags accept a file path to a JSON config file.
  • If the file is missing, or can't be parsed as JSON, exit with an appropriate error message.
  • If the -c or --config option is provided, ignore all other options (i.e., a config file overrides other options on the command line).
  • The program should ignore any options in the config file it doesn't recognize. For example, if the SSG doesn't support stylesheets, ignore a stylesheet property.
  • If the config file is missing any options, assume the usual defaults.

Feature: Markdown Front Matter support

Continued from #16

Docusaurus has meta data for Markdown files as documented.
Data includes;

  • id
  • title
  • pagination_label
  • sidebar_label
  • sidebar_position
  • sidebar_class_name
  • hide_title
  • hide_table_of_contents
  • toc_min_heading_level
  • toc_max_heading_level
  • pagination_next
  • pagination_prev
  • parse_number_prefixes
  • custom_edit_url
  • keywords
  • description
  • image
  • slug
  • tags

To implement Front Matter for Markdown,

  • Separate meta data with body content
  • Choose which meta data can be stored (doesn't necessarily have to be the whole list above)

For now the meta data are 'id', 'title', 'hide_title', 'description', 'stylesheet', 'image'

  • Create a Front Matter parser
  • Allow the meta data to be used/referenced in the Markdown File.
    For example
---
id: SomeFileName
title: a title
image: /image.url
---
# {{ title }}
[image]( {{ image }} )

Should alternate the Markdown file content as

# a title
[image]( /image.url )
  • Continued improvement (see comments below)

Failed HTML markup validation for index.html.

I have tested the HTML files in Validator. I tried to input a folder to generate multiple files + index.html. Generated pages from processed text files were valid. However, the index.html failed markup validation. Please consider reviewing the image below.

Screen Shot 2021-09-17 at 4 46 50 PM

Add more validaiton on reading file extensions.

I have duplicated the file "Silver Blaze.txt", and added additional extension. "Silver Blaze.txt.t". The tool still has processed the file. I think that the tool is needed more validation.
Screen Shot 2021-09-17 at 5 12 14 PM

Screen Shot 2021-09-17 at 5 14 13 PM

Add Markdown support.

Current static generator supports .txt files format.

I am going to add a new support for Markdown (.md) files. Specifically, I am going to implement several Markdown features: headers (1,2,3), links, italic and bold texts. In addition, I will provide documentation on Markdown support in README.md file.

Enhancement: Markdown Features based on Docusaurus

With Docusaurus as a template, current markdown support for SiteGen is too basic, lacking many features.

  • Swap basic markdown support for full open source one.
  • Apply syntax highlights to in block code (issue #18 )
  • Markdown Front Matter support (issue #19 )
  • MDX and React Component support (issue #20 )
  • Admonitions (issue #21 )
  • #23

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.