JuliaDocs / DemoCards.jl

Let's focus on writing demos
MIT License
66 stars 14 forks source link

add stylesheet field to DemoPage #104

Closed piever closed 2 years ago

piever commented 2 years ago

Fix #101. This allows to pass a custom stylesheet in the config file, eg.

{theme: "grid", stylesheet: "/path/to/custom.css"}

to be used instead of the default style. I think this is a reasonable solution, as it's simple for the user to copy-paste the default style and tweak as needed (for example, tweak paddings, margins, shadows, dimensions, etc...).

Have yet to finalize the PR, but wanted to know if we are happy with this solution before proceeding with tests, docs, and path renormalization.

Another alternative is to embrace the fact that Documenter uses Bulma for styling, and implement the card as a bulma card component. Let me know if you have preferences either way. (The two things are probably not mutually exclusive, it could make sense to pass custom css even if the default styling is made with Bulma).

EDIT: happy to give a stab at the bulma theme, but maybe it should be done as a separate style, e.g. gridbulma, to minimize breakage.

johnnychen94 commented 2 years ago

Love this! I'm sorry that I haven't yet put my hands on it since you opened the issue.

I don't have any preference here so any change that satisfies your need would be good to me. I believe you have better vision than me on how it should be.

piever commented 2 years ago

Love this! I'm sorry that I haven't yet put my hands on it since you opened the issue.

No problem, glad you like the approach! I'll try to finalize this (which I think we need anyway, I don't think a finite set of built-in styles can be good enough to satisfy all usecases), and then see how easy / hard it is to also provide themes based on bulma.

codecov[bot] commented 2 years ago

Codecov Report

Merging #104 (6201aff) into master (7e7c4e3) will increase coverage by 1.01%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #104      +/-   ##
==========================================
+ Coverage   87.91%   88.92%   +1.01%     
==========================================
  Files          15       15              
  Lines         844      849       +5     
==========================================
+ Hits          742      755      +13     
+ Misses        102       94       -8     
Impacted Files Coverage Δ
src/generate.jl 80.84% <100.00%> (+3.84%) :arrow_up:
src/preview.jl 94.05% <100.00%> (ø)
src/types/page.jl 92.23% <100.00%> (+0.31%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 7e7c4e3...6201aff. Read the comment docs.

johnnychen94 commented 2 years ago

@piever I continued your work here by adding tests and docs. I plan to make a new patch release for this and #105