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

Add Mermaid chart support to readme files #3348

Open
daveverwer opened this issue Aug 30, 2024 Discussed in #3346 · 3 comments
Open

Add Mermaid chart support to readme files #3348

daveverwer opened this issue Aug 30, 2024 Discussed in #3346 · 3 comments

Comments

@daveverwer
Copy link
Member

Discussed in #3346

Originally posted by leogdion August 29, 2024

From https://github.com/brightdigit/SublimationBonjour from GitHub brightdigit/SublimationBonjour Repo

Mermaid is supported by Github Markdown...

From From Swift Package Index brightidigt/SublimationBonjour Page

... but not the Swift Package Index site.

It seems that the javascript needs to be added to automatically parse these pre tags.

I'd love to help add support to this if needed.

@daveverwer
Copy link
Member Author

I took a look and I think this would be a good addition to the site if you wanted to work on it, Leo.

You’ll already find a ReadmeController in readme_controller.js and you’ll probably need to add a connect function to initialise the Mermaid rendering there. Looks like there’s a standard package for rendering, so let’s use that. If you need to pre-process the HTML (which I don’t think will be necessary), we mainly do that in Swift in PackageReadme+Model.swift.

You can also find any readme-specific styles that you might need in readme.scss.

It should be a nicely self-contained bit of functionality. 👍

I’ll convert this into an issue now so we can track it and for any further discussion. I’m also happy to help out if you need any help getting up and running with the front-end development environment or with anything to do with the changes.

@leogdion
Copy link
Contributor

Thanks @daveverwer for the hints and the database backup. Unfortunately when I try to load a a package page I'm not getting any of the README content:

Screenshot 2024-10-24 at 13 26 49
  • Is there a step I'm missing?
  • It looks like that's pull from S3. Is there a way to do this or bypass it for development?

Leo

PS: I also had to change the Makefile to increase the size of the spi_dev to import the data:

	docker run --name spi_dev -e POSTGRES_DB=spi_dev -e POSTGRES_USER=spi_dev -e POSTGRES_PASSWORD=xxx -p 6432:5432 \
	-e PGDATA=/pgdata \
	--tmpfs /pgdata:rw,noexec,nosuid,size=1024m \
	-d postgres:16-alpine

@daveverwer
Copy link
Member Author

Thanks @daveverwer for the hints and the database backup. Unfortunately when I try to load a a package page I'm not getting any of the README content:

Apologies, @leogdion, you also need an environment variable to be set for the scheme. Set it up like this:

Screenshot 2024-10-25 at 08 28 19@2x

PS: I also had to change the Makefile to increase the size of the spi_dev to import the data:

This is odd, I've not had to do that. Glad it's working though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants