Skip to content

Latest commit

 

History

18 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Static

A simple static website generator.

The markdown parser supports the following elements from the CommonMark Spec:

  • Thematic breaks
  • ATX headings
  • Indented code blocks
  • Fenced code blocks
  • Paragraphs
  • Blank lines
  • Block quotes
  • Lists and list items
  • Code spans
  • Emphasis and strong emphasis
  • Images

To do

  • Implement md to html function - TODO: this bit next!
    • takes input markdown file and returns a readable stream of characters for the content block
    • generates paragraphs
    • generates code blocks
    • generates italics and emphasis
    • generates tags
    • generates links
  • Implement template rendering of webpage
    • input path for which template to use (defaults to base.html)
    • template is parsed, components are fetched and necessary params are logged
    • return string of html using template.render
      • render accepts arguments for the necessary data used by the template
      • data is inserted into the html template at the correct points
      • allow parsing @foreach statements
  • build.ts links together all of the parts mentioned above, including selecting

Steps

  • Accept markdown input
  • Parse frontmatter
  • Convert Markdown → HTML
  • Choose template
  • Render template with page data
  • Write HTML to static

Notes

  • An ordered list cannot interrupt a paragraph unless it starts with "1.", but the current implementation is forgiving.
  • List items cannot be empty in this implementation
  • Currently no option for soft line breaks to be rendered as hard line breaks

About

A simple static site generator

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages