Skip to content

Commit

Permalink
Add specific examples to markdown README
Browse files Browse the repository at this point in the history
  • Loading branch information
marcuswhybrow committed Apr 18, 2024
1 parent 7cbc8fb commit 9e8ef29
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/markdown/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ This project is using the [Goldmark](https://github.com/yuin/goldmark) markdown
Following Goldmark convesion, each extension is split over multiple directories.

- `extension` contains the entry point for each extension, just a few lines of code that's called from `./cmd/ray-peat-rodeo/main.go`.
- `parser` defines under what conditions an extension get's to execute logic. Goldmark is an Abstract Syntax Tree based parser. This means it scans the input markdown one character at a time from top to bottom, creating nodes, e.g. paragraphs, links, blockquotes. This is where we register our own logic to create our own custom nodes.
- `ast` defines the Abstract Syntax Tree nodes that the parser code will create.
- `render` defines how our custom nodes render themselves into HTML.
- `parser` defines under what conditions an extension get's to execute logic. Goldmark is an Abstract Syntax Tree based parser. This means it scans the input markdown one character at a time from top to bottom, creating nodes, e.g. paragraphs, links, blockquotes. This is where we register our own logic to create our own custom nodes. This part can be quite difficult to visualise, and takes some trial and error.
- `ast` defines the Abstract Syntax Tree nodes that the parser code will create. Each node contains all the data it represents. For example timestamps contain the time.
- `render` defines how our custom nodes render themselves into HTML, e.g. mentions render HTML to create a popup that summarises all other mentions.
- `transformer` has code that operates on the completed AST. Useful for small adjustments to existing nodes otherwise outside our control, e.g. links.

0 comments on commit 9e8ef29

Please sign in to comment.