Skip to content
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

Include Jupyter notebooks as file type #9

Merged
merged 1 commit into from
Mar 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# WordPress Plugin - Publish Documents from Git

This WordPress Plugin lets you easily publish, collaborate on and version control your \[**Markdown**\] documents directly from your favorite remote Git platform, even if it's self-hosted.
This WordPress Plugin lets you easily publish, collaborate on and version control your \[**Markdown, Jupyter notebook**\] documents directly from your favorite remote Git platform, **even if it's self-hosted**.

The advantages are:

- Write Markdown in your favorite editor and just push to your remote repository to update your blog instantly
- Write documents in your favorite editor and just push to your remote repository to update your blog instantly
- Use the power of version control: publish different versions of the document in different posts, i.e. from another branch or commit than latest `master`
- Easy to update by external users via pull requests, minimizes the chance of stale tutorials

The following document types are currently supported:

- Markdown
- Jupyter notebooks (**only Github supported**)

The following platforms are currently supported:

Expand All @@ -35,6 +36,7 @@ The document-specific shortcode follow a pattern of `[git-<platform>-<action>]`,
- `gitlab`: if you use Gitlab as your VCS platform
- `<action>` can be one of
- `markdown`: Render your Markdown files hosted on your VCS platform in Github's rendering style
- `jupyter`: Render your Jupyter notebook hosted on your VCS platfrom (**only Github supported**)
- `checkout`: Renders a small badge-like box with a link to the document and the date of the last commit
- `history`: Renders a `<h2>` section with the last commit dates, messages and authors

Expand All @@ -56,7 +58,7 @@ Additionally, there's an enclosing shortcode `[git-add-css]` which adds a `<div

### Attributes

Each shortcode takes a few attributes, indicating if it's required for pubic or private repositories:
Each shortcode takes a few attributes, indicating if it's required for public or private repositories:

| Attribute | Action | Public repo | Private repo | Type | Description |
|-----------|--------------------------|-------------------------------|-------------------------------|---------|---------------------------------------------------------------------------------------------------------------|
Expand Down
216 changes: 216 additions & 0 deletions css/nbconvert.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
div.nbconvert iframe {
padding-top: 1rem;
}

div.nbconvert .input pre, .output pre {
text-align: left;
}

div.nbconvert div .dataframe {
border:none;
margin: 0 auto;
}


div.nbconvert div.output_stdout pre {
max-height:300px;
}

div.nbconvert div.output_stderr pre
{
background: #fdd;
margin:0;
max-height:300px;
}

div.nbconvert div.hl-ipython3 pre {
margin:0
}

div.nbconvert .dataframe thead tr:only-child th {
text-align: right;
text-transform: capitalize;
}

div.nbconvert .dataframe thead th {
text-align: left;
}

div.nbconvert .dataframe tbody tr th {
vertical-align: top;
}

div.nbconvert .rendered_html tbody tr:nth-child(odd),
div.nbconvert .rendered_html tbody tr:nth-child(odd) td {
background: #f5f5f5;
}

div.nbconvert .rendered_html tr,
div.nbconvert .rendered_html th,
div.nbconvert .rendered_html td {
text-align: right;
vertical-align: middle;
padding: 0.5em 0.5em;
line-height: normal;
white-space: normal;
max-width: none;
border: none;
}

div.nbconvert div.highlight .kn,
div.nbconvert .n,
div.nbconvert .k,
div.nbconvert .nn,
div.nbconvert .s1,
div.nbconvert .ow,
div.nbconvert .p,
div.nbconvert .mi,
div.nbconvert .c,
div.nbconvert .mf,
div.nbconvert .nb,
div.nbconvert .kc,
div.nbconvert .sd,
div.nbconvert .nf {
font-family: monospace;
font-size:14px;

}

div.nbconvert .input_prompt {
color: #303F9F;
font-weight: bold;
float: left;
margin-right: 5px;
margin-top: 3px;
}
div.nbconvert .input_area pre {
border: 1px solid #cfcfcf;
border-radius: 2px;
background: #f7f7f7;
line-height: 1.21429em;
padding: 6px 3px 6px 6px;
}

div.nbconvert .output_prompt{
color:#cc0000;
font-weight: bold;
}
div.nbconvert .prompt{
font-family: monospace;
font-size: 14px;
float: left;
}
div.nbconvert .c,
div.nbconvert c1 {
color: #408080;
font-style: italic;
}
div.nbconvert .k {
color: #338822;
font-weight: bold;
}
div.nbconvert .kn {
color: #338822;
font-weight: bold;
}

div.nbconvert .mi {
color: #008800;
}
div.nbconvert .mf {
color: #008800;

}
div.nbconvert .o {
color: #9966ff;
}
div.nbconvert .ow {
color: #BA22FF;
font-weight: bold;
}
div.nbconvert .nb {
color: #338822;
}
div.nbconvert .n {
color: #000000;
}
div.nbconvert .s,
div.nbconvert .s1,
div.nbconvert .sd,
div.nbconvert .s2 {
color: #cc2222;
}
div.nbconvert .se {
color: #cc2222;
font-weight: bold;
}
div.nbconvert .si {
color: #C06688;
font-weight: bold;
}
div.nbconvert .nn {
color: #4D00FF;
font-weight: bold;
}
div.nbconvert div.prompt.output_prompt + div.output_area pre {
background-color: #FFFFFF;
}

div.nbconvert .output_stdout pre {
background-color: #FFFFFF;
padding-left:10%;
}

div.nbconvert div.output_area pre {
margin: 0;
padding: 0;
border: 0;
vertical-align: baseline;
color: #000;
background-color: transparent;
border-radius: 0;
}

div.nbconvert a.anchor-link:link {
text-decoration: none;
padding: 0 20px;
visibility: hidden;
}
div.nbconvert a:focus,
div.nbconvert a:hover {
color: #23527c;
text-decoration: underline;
}


div.nbconvert .code_cell {
padding-left: 1%;
}
div.nbconvert .cell {
margin-top: 10px;
margin-bottom: 10px;
}
div.nbconvert br {
line-height: 2;
}
div.nbconvert blockquote {
font-size: 1em;
text-align: left;
font-weight: normal;
}
div.nbconvert code {
border: none;
box-shadow: none;
font-family: monospace;
}
div.nbconvert div.rendered_html h1,
div.nbconvert div.rendered_html h2,
div.nbconvert div.rendered_html h3,
div.nbconvert div.rendered_html h4 {
margin-top: 30px;
margin-bottom: 10px;
}

div.nbconvert div.rendered_html p a {
color: #4D00FF;
}
Loading