Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Support converting elements to HTML #63

Closed
chipsenkbeil opened this issue Oct 21, 2020 · 4 comments · Fixed by #113
Closed

Support converting elements to HTML #63

chipsenkbeil opened this issue Oct 21, 2020 · 4 comments · Fixed by #113
Labels
enhancement New feature or request
Milestone

Comments

@chipsenkbeil
Copy link
Owner

This should be fairly straightforward. Not sure if I'd want to use typed-html given it is not maintained, but having some type guarantees would be nice and it can still produce string output.

Idea would be to have some trait that all elements implement:

pub trait ToHtml {
    fn to_html_string(&self) -> String;
}

Not sure if it actually needs to be a trait. I guess for supporting trait objects if we needed that, this trait would be helpful.

@chipsenkbeil chipsenkbeil added the enhancement New feature or request label Oct 21, 2020
@chipsenkbeil chipsenkbeil added this to the MVP milestone Oct 21, 2020
@chipsenkbeil chipsenkbeil added this to To do in vimwiki-core via automation Oct 21, 2020
@chipsenkbeil chipsenkbeil modified the milestones: 0.1, 0.2 Oct 27, 2020
@chipsenkbeil
Copy link
Owner Author

Maybe leverage html5ever crate to parse and write back out the HTML produced? Need to see if this actually formats the html. See example

@chipsenkbeil
Copy link
Owner Author

If we don't care about formatting, can also just use htmlescape to do proper sanitization of HTML generated.

@chipsenkbeil
Copy link
Owner Author

Actually, use https://github.com/rust-ammonia/ammonia as it seems to be more modern, well-supported, and faster.

@chipsenkbeil chipsenkbeil modified the milestones: 0.2, 0.1 Apr 25, 2021
@chipsenkbeil
Copy link
Owner Author

Should provide some way to keep track of indentation

vimwiki-core automation moved this from To do to Done May 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
vimwiki-core
  
Done
Development

Successfully merging a pull request may close this issue.

1 participant