Markdown parsing with Junie
Parsing md files for statistics
Iteration 1
GoodPrompt
Create a stand-alone rust script collect_data.rs that analyzes .md files from content/agents/
Gather the tags from each file and write them to contents/agents/_index.md. The tags are defined in a toml; example below
+++
tags = ['junie','fuzzier','kotlin']
title = 'Implementing a search improvement using Junie'
categories = 'agent-testing'
+++
Result
It collected unique tags from the files and wrote them as tags to the_index.md.
Which again is fine, but now what I was looking for.
Iteration 2
GoodPrompt
Instead of collecting and writing unique tags to thecontent/agents/_index.md collect the amount of tags and display them as a table on the index file
Result
Nothing strange, it did what it was supposed to.Iteration 3 (new task)
GoodPrompt
Let’s add a new layer of parsing to the collect_data.rs rust script
We should parse all instances of the following patterns in the .md files which it already processes:
An example of the shortcode structure. CBA to add it because it breaks generation
Basically parse these from the files:
short_result="Good"
From this structure, we want to collect the short_value field values and the actual count of instances. This should then be mapped to the tag values that are already collected and displayed on the content/agents/_index.md
Result
It just works. Minor mistake on the categories toml.Iteration 4
GoodPrompt
Add some styling to the markdown table in_index.md and order the short values based on the positivity
Result
Styling was done wrong.
Ordering was correct.
Iteration 5
OkayPrompt
The styling / div does not work as expected. I’m using Hugo to generate the page, try the styling againResult
A minor syntax error that prevented the style from loading, but otherwise it is working as expected.
Or so I thought, this had appeareded to my hugo.toml and is probably not the way that I want to handle this even if the end result was what I asked.
[markup]
[markup.goldmark]
[markup.goldmark.renderer]
unsafe = true
I didn’t like the solution, so I used my own by adding a custom css file which provides the styling.
Conclusion
The actual Rust implementation is a bit heavy, but it does do what I hoped it would.
This was a nice to have so can’t complain.