Skip to content
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

feat: render .md files from packages #2540

Merged
merged 8 commits into from
Aug 15, 2024

Conversation

alexiscolin
Copy link
Member

@alexiscolin alexiscolin commented Jul 8, 2024

This PR aims to solves #2494 in order to parse markdown files from packages templates. It currently uses the file extension (from window.location) to detect if the content is a md file in a package template.

Although keeping the extension in the url is not a good practice for SEO & UX (because we are using pretty URLs for some other contents and are not consistent throughout gnoweb), This should do the work for now as short term solution since we are gonna parse .md from go soon with the new gnoweb design/codebase refactor (cc @gfanton).

It also improves the package file template by removing global JS and pushing the source content into the main rendering flow from renderer.js.

@github-actions github-actions bot added the 📦 ⛰️ gno.land Issues or PRs gno.land package related label Jul 8, 2024
@alexiscolin alexiscolin requested a review from leohhhn July 8, 2024 04:26
Copy link

codecov bot commented Jul 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.15%. Comparing base (25f1c92) to head (1397ca7).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2540      +/-   ##
==========================================
- Coverage   60.15%   60.15%   -0.01%     
==========================================
  Files         561      561              
  Lines       74999    74999              
==========================================
- Hits        45117    45115       -2     
- Misses      26505    26506       +1     
- Partials     3377     3378       +1     
Flag Coverage Δ
contribs/gnodev 61.40% <ø> (ø)
contribs/gnofaucet 14.46% <ø> (ø)
gno.land 64.75% <ø> (ø)
gnovm 64.13% <ø> (ø)
misc/genstd 80.54% <ø> (ø)
misc/logos 19.88% <ø> (-0.36%) ⬇️
tm2 62.09% <ø> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@moul
Copy link
Member

moul commented Jul 8, 2024

Hey Alexis, thank you!

Could you please share some before and after screenshots when making UX changes? We're hoping to have automatic deployment with @gfanton's upcoming refactor and @sw360cab's scripts. Until then, we'll need to manually share the changes to avoid requiring everyone to install and run the tool.

@alexiscolin
Copy link
Member Author

alexiscolin commented Jul 8, 2024

Hey @moul 👋
Sure!

Here is the current version (live version from gno.land) of a ReadMe file from package template.

gno land_r_demo_boards_README md

And here is the new version from the current PR (not in code block but markdown parsed by MarkedJs)

127 0 0 1_8888_r_demo_boards_README md

Other pages keep the same design (code and markdown). For example:

Code from package template

127 0 0 1_8888_p_demo_grc_grc721_grc721_metadata gno

markdown rendered from realm

127 0 0 1_8888_

Copy link
Member

@moul moul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for the result, but I don't have the skill to review the JS.

Copy link
Member

@zivkovicmilos zivkovicmilos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 🚀

@zivkovicmilos zivkovicmilos merged commit 6f7f589 into gnolang:master Aug 15, 2024
117 checks passed
MikaelVallenet pushed a commit to MikaelVallenet/gno that referenced this pull request Aug 17, 2024
<!-- please provide a detailed description of the changes made in this
pull request. -->
This PR aims to solves gnolang#2494 in order to parse `markdown` files from
packages templates. It currently uses the file extension (from
`window.location`) to detect if the content is a `md` file in a package
template.

_Although keeping the extension in the url is not a good practice for
SEO & UX (because we are using pretty URLs for some other contents and
are not consistent throughout gnoweb), This should do the work for now
as short term solution since we are gonna parse `.md` from `go` soon
with the new gnoweb design/codebase refactor (cc @gfanton)._

It also improves the package file template by removing global JS and
pushing the `source` content into the main rendering flow from
`renderer.js`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 ⛰️ gno.land Issues or PRs gno.land package related
Projects
Status: Done
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants