-
Notifications
You must be signed in to change notification settings - Fork 184
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
Support Alternate Themes #112
Comments
What exactly do you dislike?
Our current Regarding the alternatives:
Anyways, the frontend stuff is a bit outside my expertise, so we'd need a contributor to take the lead if we wanted alternative viewers. Another longterm option would be to use a JATS XML viewer, such as Lens Viewer (dependent on JATS export in #82). Then the webpage could look like this. Note that currently the way we generate the PDF is to use WeasyPrint to essentially print the webpage to PDF. Ideally, we want nice HTML and PDF output. |
If you're looking for the most beefy Manubot manuscripts out there, the following are good options:
If a display style works for these manuscripts, that's good as they are long and have lot's of formatting and complexity. |
I am trying to make a double-spaced PDF of a manuscript for editing without changing the display on the web for others. @vincerubinetti's suggestion in #169 of setting
|
@michaelmhoffman In the future we'll have some easy way to do this, since line spacing is a pretty common variation. For now though, you can try this: Create a new theme file |
Would you support moving the CSS to |
I'm not sure what you mean. If you look at the theme files, they really are just CSS. The only reason we give them the In other words, it already is modular. If you add another theme, it's just like adding more CSS. You'll keep the old CSS rules/classes/etc, and add the new ones. |
@michaelmhoffman is your ideal behavior:
@vincerubinetti is there a line in |
Yes: rootstock/build/themes/default.html Line 502 in 9f16be0
Unfortunately because of the nature of CSS and fonts, setting |
If the theme were in a CSS file that we could easily The only way to inherit now is to add an additional |
@michaelmhoffman would you have the time to open a PR that does this? It would help us evaluate to see the implementation. You could even create a stub PR with the |
Stub PR would be no problem. |
I've got a general question about the default theme. Maybe even a serif font would be nice however I know that some people don't like them. |
This good feedback and good references. I think we'll want to have several themes in the (hopefully near) future that make variations on font style and level of compactness, as people have different preferences. Personally I wasn't a fan of the compactification, but I understand why other people wanted it, for papers that could be 50 pages instead of 90. Perhaps we could have different "modes" that are kinda separate from themes that switch things like compactness. |
Thanks for weighing in. I guess different users will prefer different PDF styles. We'll work on a larger more readable option for printing. I also wanted to note paged.js, which may be useful for converting HTML manuscripts to PDF with things like page numbers. I saw PubPub is using it. |
Oh their page looks really nice. |
Would it be possible to split the CSS into multiple files and include them in the HTML file?
|
+1 for modularizing the style stuff a bit. |
I think we'll definitely split the CSS up into multiple files, but as to how we make that split will have to be chosen extremely carefully to avoid causing a lot of strife down the road with rules overlapping and overriding each other unexpectedly. As far as moving them to their own file, I'm not sure exactly what you mean. If you mean hot-linking to some other location, say on Manubot servers or repos, we want to avoid doing that because we want exported papers to be completely self contained; we want them to have everything they need even if external resources go down (with the special exception of Hypothesis). We can consider minifying the javascript or CSS in some way to make the output html file more manageable. I agree it's quite versbose and hard to read if you need to edit its source code. As far as actual file size goes though, it's just a text file, and I don't think we necessarily need to optimize for that. |
I agree with this but think that splitting the CSS might actually help with that.
I mean using them just like this:
I absolutely agree that we should avoid external dependencies as much as possible.
With large I meant long and therefore hard to read/understand. Splitting it into logical parts would already be enough to help with that. |
Yes we could do that, and it would help with people being able to find the CSS they're looking for. The overlap I was referring to is CSS-related. Since they're all ending up in the same html file, CSS class and id names can conflict.
Okay, so you're talking about splitting them out into separate files and keeping them locally along with the outputted I originally didn't want to do this because if the user wanted to move the manuscript somewhere (like put it on their personal site or something), they'd have to remember to copy all the extra dependencies (and some people may not even know what CSS and javascript are). Whereas if it was a single bundled Another thing was, all the other output formats ( However maybe we can make the output folder look like this instead:
|
Are there many things specified multiple times?
Maybe we could compile one large HTML file with everything in it?
Would look nice as well and is easy to understand for someone with basic knowledge of web development. |
Right now no. This would be after our attempts to make separate themes and variations on those themes, like compact print. We could make our themes totally self-complete, meaning you're only supposed to use 1 at a time. This would lead to a lot of code duplication though, as a lot of the styles from a "contemporary" serif-type theme would probably be the exact same as the current default theme. Plugin .css also makes this more complicated. It might be not as bad as I'm imagining, I'm just saying it has to be considered. But I'll work on it and we'll see how it goes. EDIT* I want to clarify, if I (or just one person) was the only one ever touching any CSS, it wouldn't be a problem to make sure there's no conflicts. The main issue is making it such that if a user ever writes their own CSS rules/styles, they behave as expected, as much as possible.
Unfortunately the land of HTML and CSS is much worse than a typical programming, especially with regard to the scoping of things. As the designated person to suffer through this, I'll handle it as I'm building it. But I suppose it's something regular users and other developers should at least be aware of.
Yeah, for those who don't know, you can embed essentially anything in an HTML document by converting it to a data URI, a long string of base64 encoded data. This would definitely make the resulting HTML file harder to read, though. But it would be 100% self-contained. Also if we strongly encourage people to make their figures as Depends if we want to have a nice readable output html, or a full self-contained html. I would recommend we choose one or the other, but do it fully that way, not half-way of each. @dhimmel thoughts? |
It just came to my mind that it would be nice if manubot had a namespace in the CSS. |
It is difficult to read a long manuscript with the current style settings.
It might be useful to build on the work of other projects which convert Markdown into the usual academic style:
https://github.com/ickc/markdown-latex-css
https://github.com/thomaspark/pubcss/ // https://thomaspark.co/project/pubcss/demo/acm-sig-sample-web-theme.html
https://gist.github.com/killercup/5917178
etc
The text was updated successfully, but these errors were encountered: