-
-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Markdown + YAML for the timeline #1293
Conversation
✅ Deploy Preview for pydis-static ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
This is great !!!!!! |
This is still great !!!!!!!!!!!!! |
fccac4a
to
d231e29
Compare
- The timeline app is introduced, moved from the home app. - Add a basic README.md to illustrate the overall code breakdown of the app as it is in the current stage. - Two entries are added for now. - Add ability to link headers using the slug portion of the filename. - The way markdown files are fetched is similar to that of the resources app - using the AppConfig ready() function, all resources are ensured to be only fetched once when the app is first laoded. I debated whether to introduce the new functionality in the home app instead, without creating a new app. Eventually I decided extracting it to a standalone app now is better as it allows easier extension of functionality in the future. The home app can remain as it is to only server the `/` homepage. The timeline CSS is kept the same, as with the structure of the timeline HTML template. Once the CSS rewrite PR is merged, it's relatively easy to fix conflicts here (again, since timeline is now its own app, with the CSS file and HTML template moved - extra advantage). References to `home:timeline` are updated to use `timeline:index` throughout the codebase, as far as my ripgrep search could go. The format of the markdown + YAML entries are still up for debate, so I've only added the first two entries for now. They can be completely overwritten in the future once the formats are decided by using a script to convert all the data from my JSON file into individual markdown files: http://0x0.st/Xr78.txt This link should last for at least a few months. (Originally saved on https://paste.pythondiscord.com/KPJA, but it expires on 12th April 2024.)
- There might be missing HTML that was stripped by `markdownify` - Slugs were converted from kebab-casing titles and editorizing to make everything shorter (thanks to oil.nvim) - I should've just used Python and arrow (for the dates), but before I realized arrow existed Nushell had the best built-in support. - Markdown is wrapped at 80
I fixed them in PRs that were merged after the JSON used for this conversion was generated.
d231e29
to
26f71cd
Compare
897cba8
to
b66c405
Compare
A separate paragraph was used in the HTML, but another <p> was not actually used.
b66c405
to
e3c697f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great, only one issue I noticed.
I wonder if we should make the date metadata optional (to allow for date ranges) and extract it from the file name by default. This would help avoid the inconsistency of month names you mentioned
pydis_site/apps/timeline/entries/2021-07-09_summer-code-jam-2021-cj8.md
Outdated
Show resolved
Hide resolved
Good idea 👍 |
Co-authored-by: wookie184 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an excellent and super clean implementation - thank you very much!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can leave making the date field optional and extracting from the file name to potentially another PR, this is great as-is so there's no point leaving it. Let's merge
Closes #1235.
Preview: https://deploy-preview-1293--pydis-static.netlify.app/timeline/
The key used for sorting is a date in the "2006-01-02" format which comes from the filename. The latter part of the filename is used as anchor links.
The date specified in the frontmatter is the actual format used for display.
Dates shown in the timeline currently have a range of formats:
All are copied as-is from the HTML.
I went ahead to convert all files to get things going quickly, since content needed to added sooner or later. Changing the format of YAML and file names is still possible, if reviewers insist.
Conversion data and scripts for reference
Recovered JSON
Note that some iframes were stripped by markdownify.
Footnotes
There are several instances where the ordering changed in the new version, this is because some items aren't currently correctly sorted by date. For example (left is before, right is after):
↩