This repository has been archived by the owner on Nov 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Pages extension): Add the pages extension
Closes #23.
- Loading branch information
Showing
6 changed files
with
47 additions
and
1 deletion.
There are no files selected for viewing
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
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,18 @@ | ||
# Pages extension | ||
|
||
Provides a [`@media print` CSS at-rule](https://developer.mozilla.org/en-US/docs/Web/CSS/@page) to modify properties when printing a document e.g. to PDF. | ||
|
||
## Notes | ||
|
||
- This is an initial, basic, implementation. | ||
|
||
- In the future, we may use https://www.pagedmedia.org/paged-js/ for better support for the `@page` rule. | ||
|
||
- That might allow theme authors to specify additonal things to go in printed pages e.g. headers and footers, for their theme. | ||
|
||
|
||
## Resources | ||
|
||
- https://www.smashingmagazine.com/2018/05/print-stylesheets-in-2018/ | ||
|
||
- https://www.pagedmedia.org/paged-js/ |
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 @@ | ||
// Do any initialization that your extension requires here. | ||
|
||
export {} |
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,21 @@ | ||
@media print { | ||
/* Document nodes to avoid a break after */ | ||
:--Heading { | ||
page-break-after: avoid; | ||
} | ||
|
||
/* Document nodes to avoid a break inside */ | ||
:--Figure, | ||
:--Table, | ||
:--Datatable, | ||
:--MathBlock, | ||
:--CodeBlock, | ||
:--CodeChunk { | ||
page-break-inside: avoid; | ||
} | ||
|
||
/* Elements not to display */ | ||
stencila-action-menu { | ||
display: none; | ||
} | ||
} |
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,4 +1,5 @@ | ||
import '../../extensions/cite-apa' | ||
import '../../extensions/code' | ||
import '../../extensions/math' | ||
import '../../extensions/pages' | ||
import '../../extensions/person' | ||
import '../../extensions/cite-apa' |
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