-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(create-vivliostyle-theme): update default theme example based on…
… VFM document
- Loading branch information
1 parent
03afcd9
commit efb6aae
Showing
13 changed files
with
276 additions
and
18 deletions.
There are no files selected for viewing
Binary file added
BIN
+203 KB
...reate-vivliostyle-theme/templates/default/example/assets/Logo (Mark + Type).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
105 changes: 104 additions & 1 deletion
105
packages/create-vivliostyle-theme/templates/default/example/default.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,104 @@ | ||
# Theme Example | ||
--- | ||
title: 'Vivliostyle Theme Example' | ||
body: | ||
class: 'foo bar' | ||
vfm: | ||
hardLineBreaks: false | ||
--- | ||
|
||
This sample is based on [VFM (Vivliostyle Flavored Markdown) document](https://vivliostyle.github.io/vfm/vfm). If you need more information, please check the document. | ||
|
||
# Code | ||
|
||
```javascript | ||
function main() {} | ||
``` | ||
|
||
## with caption | ||
|
||
```javascript:app.js | ||
function main() {} | ||
``` | ||
|
||
or | ||
|
||
```javascript title=app.js | ||
function main() {} | ||
``` | ||
|
||
# Footnotes | ||
|
||
VFM is developed in the GitHub repository[^1]. | ||
Issues are managed on GitHub[^issues]. | ||
Footnotes can also be written inline^[This part is a footnote.]. | ||
|
||
[^1]: [VFM](https://github.com/vivliostyle/vfm) | ||
[^issues]: [Issues](https://github.com/vivliostyle/vfm/issues) | ||
|
||
# Frontmater | ||
|
||
(You can define metadata on the top of the Markdown file. Try to set `lang` option `ja` in the frontmatter! If you need more information, please check [Frontmatter part in VFM document](https://vivliostyle.github.io/vfm/vfm#frontmatter).) | ||
|
||
# Hard new line | ||
|
||
(Try to set the `hardLineBreaks` option `true` in the frontmatter!) | ||
|
||
はじめまして。 | ||
|
||
Vivliostyle Flavored Markdown(略して VFM)の世界へようこそ。 | ||
VFM は出版物の執筆に適した Markdown 方言であり、Vivliostyle プロジェクトのために策定・実装されました。 | ||
|
||
# Image | ||
|
||
![](<./assets/Logo%20(Mark%20+%20Type).png>) | ||
|
||
## with caption and single line | ||
|
||
![Vivliostyle Logo](<./assets/Logo%20(Mark%20+%20Type).png>) | ||
|
||
![Vivliostyle Logo](<./assets/Logo%20(Mark%20+%20Type).png> 'distributed on the official website'){id="image" data-sample="sample"} | ||
|
||
text ![Vivliostyle Logo](<./assets/Logo%20(Mark%20+%20Type).png>) | ||
|
||
# Math equation | ||
|
||
inline: $x = y$ | ||
|
||
display: $$1 + 1 = 2$$ | ||
|
||
# Raw HTML | ||
|
||
<div class="custom"> | ||
<p>Hey</p> | ||
</div> | ||
|
||
## with Markdown | ||
|
||
<div class="custom"> | ||
|
||
- hoge | ||
- fuga | ||
|
||
</div> | ||
|
||
# Ruby | ||
|
||
This is {Ruby|ルビ} | ||
|
||
## Escape pipe in ruby body | ||
|
||
{a\|b|c} | ||
|
||
# Sectionization | ||
|
||
# Plain | ||
|
||
# Introduction {#intro} | ||
|
||
# Welcome {.title} | ||
|
||
# Level 1 | ||
|
||
## Level 2 | ||
|
||
> # Not Sectionize |
4 changes: 4 additions & 0 deletions
4
packages/create-vivliostyle-theme/templates/default/scss/_variables.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
$color--gray: #e6e6e6; | ||
$color--gray-light: #f6f6f6; | ||
$color--red-light: #ff8989; | ||
$color--red: #de3e3e; |
20 changes: 20 additions & 0 deletions
20
packages/create-vivliostyle-theme/templates/default/scss/_vfm_code.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Syntax highlighting | ||
// https://prismjs.com | ||
@import 'https://cdnjs.cloudflare.com/ajax/libs/prism/1.25.0/themes/prism.min.css'; | ||
|
||
code { | ||
background-color: $color--gray-light; | ||
padding: 0 3pt; | ||
} | ||
|
||
figure[class^='language-'] { | ||
margin: 0.5em 0; | ||
|
||
figcaption { | ||
background-color: $color--gray; | ||
} | ||
|
||
pre { | ||
margin: 0pt; | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
packages/create-vivliostyle-theme/templates/default/scss/_vfm_footnotes.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.footnote-ref sup { | ||
background-color: $color--red-light; | ||
} | ||
|
||
.footnote-back { | ||
background-color: $color--red-light; | ||
} | ||
|
||
.footnotes { | ||
font-size: 8pt; | ||
} |
2 changes: 2 additions & 0 deletions
2
packages/create-vivliostyle-theme/templates/default/scss/_vfm_frontmatter.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.foo.bar { | ||
} |
13 changes: 13 additions & 0 deletions
13
packages/create-vivliostyle-theme/templates/default/scss/_vfm_hard_new_line.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
p { | ||
margin: 0; | ||
text-align: justify; | ||
text-indent: 3em; | ||
|
||
&:first-of-type { | ||
text-indent: 0; | ||
} | ||
|
||
:root:lang(ja) & { | ||
text-indent: 1em; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
packages/create-vivliostyle-theme/templates/default/scss/_vfm_image.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
img { | ||
max-width: 100%; | ||
} | ||
|
||
figure { | ||
img { | ||
} | ||
|
||
figcaption { | ||
text-align: center; | ||
|
||
// counter | ||
counter-increment: figure; | ||
|
||
&:before { | ||
margin-right: 1rem; | ||
content: 'Figure' counter(figure) '.'; | ||
|
||
:root:lang(ja) & { | ||
content: '図' counter(figure) '.'; | ||
} | ||
} | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
packages/create-vivliostyle-theme/templates/default/scss/_vfm_math_equation.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.math.inline { | ||
} | ||
|
||
.math.display { | ||
} |
3 changes: 3 additions & 0 deletions
3
packages/create-vivliostyle-theme/templates/default/scss/_vfm_raw_html.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.custom { | ||
color: $color--red; | ||
} |
5 changes: 5 additions & 0 deletions
5
packages/create-vivliostyle-theme/templates/default/scss/_vfm_ruby.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
ruby { | ||
rt { | ||
color: $color--red; | ||
} | ||
} |
62 changes: 62 additions & 0 deletions
62
packages/create-vivliostyle-theme/templates/default/scss/_vfm_sectionization.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
body > section { | ||
margin: 10px auto; | ||
} | ||
|
||
html { | ||
// counter | ||
counter-reset: section subsection figure; | ||
} | ||
|
||
section > { | ||
h1, | ||
h2, | ||
h3, | ||
h4, | ||
h5, | ||
h6 { | ||
padding: 0; | ||
font-weight: bold; | ||
break-after: avoid; | ||
} | ||
|
||
h1 { | ||
margin: 10pt auto 5pt; | ||
font-size: 14pt; | ||
line-height: 1.5; | ||
|
||
// counter | ||
counter-increment: section; | ||
counter-reset: subsection; | ||
|
||
&:before { | ||
margin-right: 1rem; | ||
content: counter(section) '.'; | ||
} | ||
} | ||
|
||
h2 { | ||
margin: 8pt auto 4pt; | ||
font-size: 12pt; | ||
|
||
// counter | ||
counter-increment: subsection; | ||
|
||
&:before { | ||
margin-right: 1rem; | ||
content: counter(section) '.' counter(subsection) '.'; | ||
} | ||
} | ||
} | ||
|
||
section.title { | ||
color: $color--red; | ||
} | ||
|
||
blockquote > h1 { | ||
font-size: inherit; | ||
} | ||
|
||
.level1 { | ||
} | ||
.level2 { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters