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 an HTML export #61

Open
aloisdg opened this issue Oct 19, 2024 · 7 comments
Open

Add an HTML export #61

aloisdg opened this issue Oct 19, 2024 · 7 comments

Comments

@aloisdg
Copy link

aloisdg commented Oct 19, 2024

Hello,

I am playing with the idea of an HTML export:

image

the goal would be to have a gui export. It would be easier to read by non tech folks. What do you think?

@aloisdg
Copy link
Author

aloisdg commented Oct 19, 2024

My draft of solution can be seen and tried on my fork: aloisdg#1

If @tbvdm likes it, we can plan to add it sigtop later on. It is not ready yet

Caveat: this is my first time writing Go without ever learning it.

@tbvdm
Copy link
Owner

tbvdm commented Oct 21, 2024

Thanks for working on this! Very promising!

Please don't forget to escape HTML in the input; use html.EscapeString for that. (It would be even better to use the html/template package, but perhaps that's something for later.)

Also, I think HTML exports should be self-contained, so please avoid stylesheets from external sources.

You probably wanted to hack something together quickly, so I understand that you took a few shortcuts. :)

@aloisdg
Copy link
Author

aloisdg commented Oct 21, 2024

Yes this is indeed a quick a dirty version. I will remove watercss later on. I now next to nothing about Golang.

I would love to extract the html from the Go file and put in a proper html file. Feel free to help with that (with a package or file loading/import logic maybe?)

@tbvdm
Copy link
Owner

tbvdm commented Oct 25, 2024

I would love to extract the html from the Go file and put in a proper html file.

You can use the embed package:

import (
	_ "embed"
	// ...
)

//go:embed header.html
var htmlHeader string

func f() {
	fmt.Print(htmlHeader)
}

@aloisdg
Copy link
Author

aloisdg commented Nov 2, 2024

Thank you I will look into that next week

@tbvdm
Copy link
Owner

tbvdm commented Nov 6, 2024

Great!

@cavalrymargarine0x1
Copy link

This would be awesome!!

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

3 participants