-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Replaced Preview's markdown.css with github-markdown-css by @sindresorhus - Added IniGroup Preview - Subclassed QWebEngineView and moved a few previously ill-parented objects to its constructor - Reordered Set and Toggle menu sections (alphabetical by IniGroup: Data, Editor, Preview, Window)
- Loading branch information
Showing
25 changed files
with
3,198 additions
and
286 deletions.
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
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,9 @@ | ||
MIT License | ||
|
||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com) | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
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,63 @@ | ||
# github-markdown-css | ||
|
||
> The minimal amount of CSS to replicate the GitHub Markdown style | ||
**The CSS is generated. Contributions should go to [this repo](https://github.com/sindresorhus/generate-github-markdown-css).** | ||
|
||
[<img src="https://cloud.githubusercontent.com/assets/170270/5219062/f22a978c-7685-11e4-8316-af25b6c89bc0.png" width="300">](http://sindresorhus.com/github-markdown-css) | ||
|
||
## [Demo](https://sindresorhus.com/github-markdown-css) | ||
|
||
## Install | ||
|
||
Download [manually](https://raw.githubusercontent.com/sindresorhus/github-markdown-css/gh-pages/github-markdown.css), from [CDNJS](https://cdnjs.com/libraries/github-markdown-css), or with npm: | ||
|
||
``` | ||
$ npm install github-markdown-css | ||
``` | ||
|
||
## Usage | ||
|
||
Import the `github-markdown.css` file and add a `markdown-body` class to the container of your rendered Markdown and set a width for it. GitHub uses `980px` width and `45px` padding, and `15px` padding for mobile. | ||
|
||
```html | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<link rel="stylesheet" href="github-markdown.css"> | ||
<style> | ||
.markdown-body { | ||
box-sizing: border-box; | ||
min-width: 200px; | ||
max-width: 980px; | ||
margin: 0 auto; | ||
padding: 45px; | ||
} | ||
@media (max-width: 767px) { | ||
.markdown-body { | ||
padding: 15px; | ||
} | ||
} | ||
</style> | ||
<article class="markdown-body"> | ||
<h1>Unicorns</h1> | ||
<p>All the things</p> | ||
</article> | ||
``` | ||
|
||
If you want code syntax highlighted, use GitHub Flavored Markdown rendered from [GitHub's `/markdown` API](https://docs.github.com/en/free-pro-team@latest/rest/reference/markdown). | ||
|
||
There are 3 themes provided in this package: | ||
|
||
- **github-markdown.css**: (default) Automatically switches between light and dark through [`@media (prefers-color-scheme)`](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme). | ||
- **github-markdown-light.css**: Light-only. | ||
- **github-markdown-dark.css**: Dark-only. | ||
|
||
You may know that now GitHub supports more than 2 themes including `dark_dimmed`, `dark_high_contrast` and `colorblind` variants. If you want to try these themes, you can generate them on your own! See next section. | ||
|
||
## How | ||
|
||
See [`generate-github-markdown-css`](https://github.com/sindresorhus/generate-github-markdown-css) for how it's generated and ability to generate your own. | ||
|
||
## Dev | ||
|
||
Run `npm run make` to update the CSS. |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
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
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,10 +1,14 @@ | ||
<RCC> | ||
<qresource prefix="/"> | ||
<file>preview/fountain.html</file> | ||
<file>preview/fountain-overwrite.css</file> | ||
<file>preview/markdown.html</file> | ||
<file>preview/markdown-overwrite.css</file> | ||
<file>preview/include/fountain.min.js</file> | ||
<file>preview/include/fountain-js.css</file> | ||
<file>preview/include/markdown.css</file> | ||
<file>preview/include/github-markdown.css</file> | ||
<file>preview/include/github-markdown-dark.css</file> | ||
<file>preview/include/github-markdown-light.css</file> | ||
<file>preview/include/marked.min.js</file> | ||
<file>preview/fountain.html</file> | ||
<file>preview/markdown.html</file> | ||
</qresource> | ||
</RCC> |
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 @@ | ||
body { | ||
} |
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,27 +1,28 @@ | ||
<!doctype html> | ||
<meta charset="utf-8"> | ||
<html lang="en"> | ||
<head> | ||
<link rel="stylesheet" href="include/fountain-js.css"> | ||
<script src="include/fountain.min.js"></script> | ||
<script src="qrc:/qtwebchannel/qwebchannel.js"></script> | ||
</head> | ||
<body> | ||
<div id="placeholder"></div> | ||
<script> | ||
'use strict'; | ||
var placeholder = document.getElementById('placeholder'); | ||
var updateText = function (text) { | ||
var output = fountain.parse(text); | ||
placeholder.innerHTML = output.html.title_page + output.html.script; | ||
<head> | ||
<link rel="stylesheet" href="include/fountain-js.css"> | ||
<link rel="stylesheet" href="fountain-overwrite.css"> | ||
<script src="include/fountain.min.js"></script> | ||
<script src="qrc:/qtwebchannel/qwebchannel.js"></script> | ||
</head> | ||
<body> | ||
<div id="text_area"></div> | ||
<script> | ||
'use strict'; | ||
var text_area = document.getElementById('text_area'); | ||
var updateText = function (text) { | ||
var output = fountain.parse(text); | ||
text_area.innerHTML = output.html.title_page + output.html.script; | ||
} | ||
new QWebChannel(qt.webChannelTransport, | ||
function(channel) { | ||
var content = channel.objects.content; | ||
updateText(content.text); | ||
content.textChanged.connect(updateText); | ||
} | ||
new QWebChannel(qt.webChannelTransport, | ||
function(channel) { | ||
var content = channel.objects.content; | ||
updateText(content.text); | ||
content.textChanged.connect(updateText); | ||
} | ||
); | ||
</script> | ||
</body> | ||
); | ||
</script> | ||
</body> | ||
</html> |
Oops, something went wrong.