Git Product home page Git Product logo

gis-ops / wordpress-markdown-git Goto Github PK

View Code? Open in Web Editor NEW
47.0 8.0 14.0 223 KB

:loop: WordPress plugin to add file content (Markdown, Jupyter notebooks) from a Git based VCS to a WordPress post; replaces https://github.com/gis-ops/md-github-wordpress

License: GNU General Public License v3.0

CSS 24.27% PHP 75.73%
markdown vcs github bitbucket wordpress wordpress-post wordpress-plugin gitlab shortcodes jupyter-notebook

wordpress-markdown-git's Introduction

WordPress Plugin - Publish Documents from Git

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 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 your readers via pull requests, minimizing the chance of stale tutorials

The following document types are currently supported:

  • Markdown
  • Jupyter notebooks (only for public repositories)

The following platforms are currently supported:

  • Github
  • Bitbucket
  • Gitlab

Usage

Note, this plugin uses Github's wonderful /markdown API to render to HTML. This comes with 2 caveats:

  1. Unless authenticated, the rate limit is set at 60 requests per minute. Since v1.1.0 the plugin is capable of statically caching content. In case that's not dynamic enough for you, your only option currently is to not use any cache in which case every document will be pulled from your provider every time someone opens it on your site. Then it's strongly recommended to create a Github access token and register it with the plugin. Then the rate limit will be set to 5000 requests per hour. See Global attributes section for details on how to do that.
  2. The Markdown content cannot exceed 400 KB, so roughly 400 000 characters incl whitespace. If not a monographic dissertation, this should not be an applicable limit though.

Configuration

In the main menu SettingsDocuments from Git you can set all important global settings.

Note, previous versions used to include a config.json. This is deprecated now due to security concerns.

Shortcodes

The plugin features a variety of shortcodes.

Publish documents

The document-specific shortcodes follow a pattern of [git-<platform>-<action>], where

  • <platform> can be one of
    • github: if you use Github as your VCS platform
    • bitbucket: if you use Bitbucket as your VCS platform
    • 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 for public repositories)
    • 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

Manipulate rendering style

Additionally, there's an enclosing shortcode [git-add-css] which adds a <div id="git-add-css" class="<classes_attribute>" to wrap its contents. That way you can manipulate the style freely with additional CSS classes. Follow these steps:

  1. Add a CSS file to your theme's root folder, which contains some classes, e.g. class1, class2, class3
  2. Enqueue the CSS file by adding wp_enqueue_style('my-style', get_template_directory_uri().'/my-style.css'); to the theme's functions.php
  3. Add the enclosing git-add-css shortcode to your post with the custom CSS classes in the classes attribute, e.g.:
[git-add-css classes="class1 class2 class3"]
    [git-gitlab-checkout url=...]
    [git-gitlab-markdown url=...]
    [git-gitlab-history url=...]
[/git-add-css]

Attributes

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

Attribute Action Public repo Private repo Type Description
url all except git-add-css ☑️ ☑️ string The browser URL of the document, e.g. https://github.com/gis-ops/wordpress-markdown-git/blob/master/README.md
user all except git-add-css ☑️ string The user name (not email) of an authorized user
token all except git-add-css ☑️ string The access token/app password for the authorized user
cache_ttl all except git-add-css integer The time in seconds that the plugin will cache, only for cache_strategy=static.
cache_strategy all except git-add-css integer Only static caching is implemented so far. dynamic caching is on the way!
limit history integer Limits the history of commits to this number. Default 5.
classes git-add-css ☑️ ☑️ string The additional CSS classes to render the content with

Caching

Often we need to prioritize speed when loading content and, in addition, it is very costly to fetch, load and format the content every time we need to read the content of the post.

This plugin soon offers 2 methods for caching, static and dynamic which can be set via the cache_strategy property.

Static caching (cache_strategy=static)

This is the default strategy, as it doesn't require any user action.

The property cache_ttl sets how many seconds the content cache will keep alive.

Currently there's no way to flush the cache manually. However, changing cache_ttl or the history limit will create a new cache.

Dynamic caching (cache_strategy=dynamic)

This is not implemented yet. See #20 for details.

Token authorization

You need to authorize via user and token if you intend to publish from a private repository. You don't need to authorize if the repository is open.

However, keep in mind that some platforms have stricter API limits for anonymous requests which are greatly extended if you provide your credentials. So even for public repos it could make sense. And unless you use this plugin's caching capabilities, it's strongly recommended to register a Github access token regardless of the VCS hosting platform, see the beginning of the chapter.

How to generate the token depends on your platform:

This plugin needs only Read access to your repositories. Keep that in mind when creating an access token.

Examples

We publish our own tutorials with this plugin: https://gis-ops.com/tutorials/.

Publish Markdown from Github

[git-github-markdown url="https://github.com/gis-ops/tutorials/blob/master/qgis/QGIS_SimplePlugin.md"]

Publish Markdown from Github with 1 hour cache

[git-github-markdown url="https://github.com/gis-ops/tutorials/blob/master/qgis/QGIS_SimplePlugin.md" cache_ttl="3600" cache_strategy="static"]

Publish Jupyter notebook from Github

[git-github-jupyter url="https://github.com/GIScience/openrouteservice-examples/blob/master/python/ortools_pubcrawl.ipynb"]

Publish from a private repository

[git-bitbucket-jupyter user=nilsnolde token=3292_2p3a_84-2af url="https://bitbucket.org/nilsnolde/test-wp-plugin/src/master/README.md"]

Display last commit and document URL from Bitbucket

[git-bitbucket-checkout url="https://bitbucket.org/nilsnolde/test-wp-plugin/src/master/README.md"]

Display commit history from Gitlab

git-gitlab-history limit=5 url="https://gitlab.com/nilsnolde/esy-osm-pbf/-/blob/master/README.md"]

Use additional CSS classes to style

The following example will put a dashed box around the whole post:

[git-add-css classes="md-dashedbox"]
    [git-github-checkout url="https://github.com/gis-ops/tutorials/blob/master/qgis/QGIS_SimplePlugin.md"]
    [git-github-markdown url="https://github.com/gis-ops/tutorials/blob/master/qgis/QGIS_SimplePlugin.md"]
    [git-github-history url="https://github.com/gis-ops/tutorials/blob/master/qgis/QGIS_SimplePlugin.md"]
[/git-add-css]

With the following CSS file contents enqueued to your theme:

div.md_dashedbox {
    position: relative;
    font-size: 0.75em;
    border: 3px dashed;
    padding: 10px;
    margin-bottom:15px
}

div.md_dashedbox div.markdown-github {
    color:white;
    line-height: 20px;
    padding: 0px 5px;
    position: absolute;
    background-color: #345;
    top: -3px;
    left: -3px;
    text-transform:none;
    font-size:1em;
    font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
}

Installation

WordPress.org

The newest release of the plugin can be installed via WordPress plugin store under the name Documents from Git.

Newest master

The newest version, which might not have made it into the plugin store yet, can be installed via the WP Pusher plugin.

Contributions from other projects

Troubleshooting

Images

Images cannot (yet) be referenced with a relative link, i.e. [some_image](./some_image.jpg) won't work, as WordPress will try to access the image relative to your WordPress installation, e.g. https://myblog.com/some_image.jpg. See #15 for a discussion on the topic.

The solution is to either

  1. upload the image to WordPress and use the provided link
  2. push the Markdown file to the cloud, view the file in the browser and copy the provider-generated image address
  3. put the images in a repository folder and reference absolute links to your repository's raw files

Note, the last two options might be more involved when the image (alongside the Markdown file) is hosted in a private repository. Either the provider provides a token-authenticated URL for hosted images which you can use (see. e.g. #13 for Bitbucket). Or publish the image(s) in a separate public repository. Or use option 1.

It's generally recommended to publish (and version) images alongside their Markdown document in Git.

API rate limit exceeded

If you encounter this message instead of seeing your rendered Markdown file, you most likely have forgotten to provide your Github username and access token in the config.json. See Global attributes for a How-To and Usage for more information why this is necessary.

Sponsors

  • PDC: Sponsored the Bitbucket integration.

alt text

wordpress-markdown-git's People

Contributors

danilopinotti avatar florinhoinarescu avatar gisops-bot avatar nilsnolde avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wordpress-markdown-git's Issues

Enable dynamic caching

With #19 hitting soon and implement static caching, closing #4 , it'd be really cool to have a dynamic way of creating & flushing a new cache.

@danilopinotti had the great idea to use webhooks from Github/Gitlab/Bitbucket (with authentication?) to achieve that. The effort is minor and mostly around parsing the POST content of the provider's webhook.

Note, static caching will always remain the default as it doesn't require any additional action on the user's side (like creating webhooks).

Deprecate this plugin

I'm planning to move away from this plugin for our blog and instead go with mkdocs and deploying it via Github Actions, which I recently did for Valhalla and the experience super pleasant. That'll also be a bit less maintenance hassle and with all the open-source projects & open infrastructures I'm currently maintaining, any single bit less (literally) is very welcome.

Some people might depend on this plugin, even if it's likely just a few users. It also will surely run for a while to come without any modifications, but I didn't even get around to test WordPress v6.x yet. I created this plugin solely for our own purposes and open sourced it out of ideology. I learned though that it's not a good idea to attempt to maintain something that is of no use to oneself. And that will soon be the case.

So if anyone feels like this is valuable enough to preserve and wants to maintain it, I'm happy to transfer the repo. If not, I won't have a problem deprecating it either. Cc @danilopinotti @LuigiBella, in fact you're the only ones I know for sure, who at least used to use this plugin, so just letting you know explicitly:)

"message":"API rate limit exceeded

Versions
Wordpress: 5.4.1
Documents for Git: Markdown Git Version 0.1 (version released on March 8th)

Describe the bug
Even though the shortcode used is with BitBucket, the following error code is sometimes displayed on the frontend:

{"message":"API rate limit exceeded for 35.208.4.157. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)","documentation_url":"https://developer.github.com/v3/#rate-limiting"}

URL where this issue can be seen: https://dahelpguide.luigibella.com/markdown-git/

Screen Shot 2020-05-08 at 5 24 01 PM

Paste the shortcode and the censored contents of config.json

[git-bitbucket-markdown user=luigibella token=5XQ8pvTDW7fJtWHqz86u url="https://bitbucket.org/pacificdisastercenter/disasteraware-master-user-guide/src/master/1.2%20test%20page.md"]

config.json file is not present in this plugin version

To Reproduce
Steps to reproduce the behavior:

  1. Install Markdown Git Version 0.1 Pushed to Github on March 8th
  2. Insert shortcode to Markdown file hosted on Bitbucket

Screenshots
Screen Shot 2020-05-08 at 5 24 01 PM

Gitlab local API

Versions
Wordpress: 5.7.2
Documents for Git: 1.1.1

Hello i have one specific case to show you,

we are in closed environement , we working only with local resource,
i see in class-base-loader.php the line for initiate the github api :

private static $GITHUB_MARKDOWN_API = 'https://api.github.com/markdown';

do u think it's verry hard to change for use a gitlab api V4 locally (https://my_own_gitlab.lan/api/v4/markdown) ?

TIA.

Dimitri

Accessibility with Gitlab markdown flavor

Hello and thanks a lot for the extension

I am deciding which system I will choose to parse Gitlab markdown to html. It is a part of a site that will be built whit WordPress. One major thing is that the documentation has to have accessibility.
After reading your documentation, I didn't find if all markdown from Gitlab can be parsed with your extension
https://docs.gitlab.com/ee/user/markdown.html
Sorry that it is not a bug, but I need to know this to decide.
if I have to post this question in another place, tell to me and sorry for the mistake.

Thanks again for your generous work sharing :)

since update: error message that I reached API call limit

Versions
Wordpress: 5.7.2
Documents for Git: 2.0.0

Describe the bug

I get this message on my posts, but no consistently. I authenticated with my GitHub username and a personal access token. I don't think that I reach 1000 calls/hour.

{"message":"API rate limit exceeded for 81.169.144.135. (But here's the good news: Authenticated requests get a higher rate 
limit. Check out the documentation for more details.)","documentation_url":"https://docs.github.com/rest/overview/resources- 
   in-the-rest-api#rate-limiting"}

image

site: m365princess.com/how-to-beautify-your-power-apps/ (and other posts, of course)

Paste the shortcode and the censored contents of config.json

As there is no config.json anymore, I will copy the new settings section:

image

The posted shortcode is [git-github-markdown url="https://github.com/LuiseFreese/blog/blob/main/PowerApps-beautify.md"]
shortcode

To Reproduce
Steps to reproduce the behavior:

  1. go to https://m365princess.com
  2. select the first blog post "How to beautify your PowerApps"

Expected behavior
should render my blogpost from https://github.com/LuiseFreese/blog/blob/main/PowerApps-beautify.md

Screenshots

Additional context

[Feature request] Skip a given number of lines

Hey! It'd be nice to have a possibility to skip a chosen number of lines at the beginning of the parsed Markdown. That's because GitHub README usually contains information that doesn't matter for the website where it's embedded. Cheers and thanks for a great plugin.

Cache posts

To avoid requesting the post from any platform even if nothing has changed since the last pull, the plugin should cache the posts. Use a HEAD request for this.

The logic to cache the post could be:

  • cache HTML from Github
  • name pattern for post: owner/org|repo|postname|datestring (or find a delimiter which can't be part of the resource URL)
  • if no file like that present, pull the post, convert raw file to HTML, cache HTML following name pattern
  • if file present:
    • issue HEAD request to the file's API location
    • extract datestring from cached file name
    • if last-modified response header is newer than extracted date string:
      • re-fetch the file contents from Git
      • convert to HTML
      • save new cache file, delete old one
    • display contents of cached file

404 - Not found - Unable to add .ipynb as blogpost

Describe the bug
Hello,
I am trying to add a notebook to my wordpress blog using this shortcode

[git-github-jupyter url="https://github.com/cawoylel/nlp4all/blob/main/asr_tutorial.ipynb"]

I'm getting a 404 - Not found. When I replace the notebook by the readme.md file at the same GitHub repository, it works.

Have someone encountered something like this ?

Removing cache_ttl does not flush cache

Wordpress: 5.6
Documents for Git: 2.1.0

When you add the cache_ttl parameter to your markdown block and then you remove it, the plugin will only serve the last cached version of the document and will stop updating the document.

I didn't config anything

To Reproduce
Steps to reproduce the behavior:

  1. Add a block: [git-gitlab-markdown user="" token="" url="" cache_ttl=""] to a wordpress page
  2. Fill it with valid parameters (i use a private repo)
  3. Save draft and preview.
  4. Remove the cache_ttl parameter.
  5. Update the document on Git{Lab,Hub}.
  6. Save draft and preview.

Expected behavior
You should see the updated version

Small Typo on Readme. :)

Hi,
the readme says
"Unless authenticated, the rate limit is set at 60 requests per minute. Since v1.1.0 the plugin is capable of statically caching content. In case that's not dynamic enough for you, it's strongly recommended to create a Github access token and register it with the plugin. Then the rate limit will be set to 5000 requests per hour. See Global attributes section for details on how to do that."
And it should say
"Unless authenticated, the rate limit is set at 60 requests per hour... "
Nothing big but easier to understand. :)
Thank you for the great project!

https://docs.github.com/en/free-pro-team@latest/rest/overview/resources-in-the-rest-api#rate-limiting

Support for checkbox [x]

Versions
Wordpress: 5.7
Documents for Git: 1.1.0

Describe the bug

Currently if person uses:

  • Test
  • Test2

Only UL/LI is respected, and [x] is written down as standard text.

Paste the shortcode and the censored contents of config.json

shortcode

config.json

To Reproduce
Steps to reproduce the behavior:

  1. Create List
  2. Insert checkbox into the list
  3. Only List is recrated and checkbox is copied as is

Expected behavior

I would expect some sort of replacement to be used, emoji or an icon (☑)

Screenshots

image

Keep in mind that my theme doesn't show UL/LI properly, but other themes do

Additional context

404 - Not Found for valid Jupyter notebook URLs

Versions
Wordpress: 5.4.2
Documents for Git: 1.0.2

Describe the bug
Given a valid URL - the page renders with "404-not found" in the block of the shortcode once loaded. The rest of the post loads fine. I'm happy to go down a debug path myself. I'm new and not sure where to start!

Paste the shortcode and the censored contents of config.json
[git-github-jupyter url="https://github.com/Data-Indepedent/pandas-everything/blob/master/pandas_functions/Pandas_Duplicated.ipynb"]

config.json
{
  "limit": 5,
  "classes": "",
  "Github": {
    "user": "gkamradt",
    "token": "*****************************"
  },
  "Bitbucket": {
    "user": "",
    "token": ""
  },
  "Gitlab": {
    "user": "",
    "token": ""
  }
}

To Reproduce
Steps to reproduce the behavior:

  1. Push file to git hub
  2. Grab URL of file you pushed
  3. Insert the URL into the shortcode within a wordpress post
  4. View post or draft and notice it is 404-not found

Expected behavior
The expected behavior is that the jupyter notebook would appear as normally. Weirdly, the same exact short code (with a different URL) loads up fine. This is the short code that loads perfect:
[git-github-jupyter url="https://github.com/Data-Indepedent/pandas-everything/blob/master/pandas_functions/Pandas%20Pop%20%7C%20pd.DataFrame.pop().ipynb"]

Screenshots

Additional context
The files were just loaded. I thought this was a timing thing, but it's been +8 hrs and still 404

Arabic language: after installing the plugin the entire site shifts right

Versions
Wordpress: 5.4.2
Documents for Git: 1.0.2

Describe the bug
i have just installed the plugin and was looking up to using it,
but when i enable it the entire website shifts right.
the control panel also shifted, and i cant disable the plugin without resizing to mobile size
image

Paste the shortcode and the censored contents of config.json

shortcode

{
  "limit": 5,
  "classes": "",
  "Github": {
    "user": "",
    "token": ""
  },
  "Bitbucket": {
    "user": "",
    "token": ""
  },
  "Gitlab": {
    "user": "",
    "token": ""
  }
}

To Reproduce
Steps to reproduce the behavior:
1.install the plugin

Expected behavior

the plugin should not shift the entire site

Screenshots

image

Additional context

the websites main language is arabic and its RTL based

Add wrapper div

Add a div which can take CSS classes and acts as an enclosing shortcode to alter the rendering at will.

WP plugin taking too long

I'm currently using Documents from Git version 1.1.0, Wordpress 5.6.2 hosted on personal hosting platform, and tried to post
jupyter nbs using the same command as: "[git-github-jupyter url="https://github.com/GIScience/openrouteservice-examples/blob/master/python/ortools_pubcrawl.ipynb"]"

However, page is still blank and seems to be not loading content, the post stays blank
Does it take a lot of time to load? Something like 24 hours.

How could I solve this problem? Any idea?

Post sample:
image

installation on PHP8.0

when activating PHP8.0, the WP admin area doesn't work anymore (my configuration is WP5.7.2 and PHP7.4). front end is fine, it works with the plugin on PHP8.0. WP admin raise fatal error. I deactivated all plugins except for documents-from-git and got same error. Then I activated all and deactivated documents-from-git and was fine. Reversed to PHP7.4 and activated all plugins ... everything came back to normal.

Images from private repos are not accessible on frontend

Versions
Wordpress: 5.4.1
Documents for Git: Markdown Git Version 0.1 (version released on March 8th)

Describe the bug
With a BitBucket MD file that uses the complete path to an image stored on BitBucket, the output on the frontend shows a URL beginning with camo.githubusercontent.com and the image is not displayed.

0

URL where this issue can be seen: https://dahelpguide.luigibella.com/markdown-git/

Paste the shortcode and the censored contents of config.json

[git-bitbucket-markdown user=luigibella token=5XQ8pvTDW7fJtWHqz86u url="https://bitbucket.org/pacificdisastercenter/disasteraware-master-user-guide/src/master/1.2%20test%20page.md"]

config.json file is not present in this plugin version

To Reproduce
Steps to reproduce the behavior:

  1. Install Markdown Git Version 0.1 Pushed to Github on March 8th
  2. Inset shortcode to BitBucket MD file with image links containing the full path to the image
  3. View on frontend

Screenshots
0

Anchor links to headers don't work

Versions
Wordpress: 5.7
Documents for Git: 1.1.1

Describe the bug

Links within the page (e.g. https://example.com/#chapter2) don't scroll the page to the destination. It seems that name="" attribute is missing within the <a> tag.
It also breaks GitHub-compatible table of contents.

Paste the shortcode and the censored contents of config.json

{
  "limit": 5,
  "cache_strategy": "static",
  "cache_ttl": 600,
  "classes": "",
  "Github": {
    "user": XXX,
    "token": XXX
  },
  "Bitbucket": {
    "user": "",
    "token": ""
  },
  "Gitlab": {
    "user": "",
    "token": ""
  }
}

To Reproduce
Steps to reproduce the behavior:

  1. Visit https://gis-ops.com/qgis-3-plugin-tutorial-geocoding-with-nominatim-part-2/#recommendations
  2. Observe it stays at the top of the page. It should jump to the destination (e.g. "Recommendations" paragraph)
  3. Visit https://techartaid.com/cheatsheet/
  4. Click on links in Table of Contents. Observe it doesn't follow to the paragraph
  5. Visit the same page on GitHub, observe it works OK: https://github.com/OskarSwierad/game-art-cheatsheet

BUG: Server Error 500

Versions
Wordpress: 5.3.1
Documents for Git: 0.1

Describe the bug
Getting an error message when viewing a page with the shortcode (see below).
500 - Server Error

The page can be accessed here:
https://eblabs.com/test-post/
pw: github

Paste the shortcode and the censored contents of config.json
[git-github-markdown url="https://raw.githubusercontent.com/eblabs/eblabs_community/master/docs/RetimeTools/README.md"]

{
  "limit": 5,
  "classes": "",
  "Github": {
    "user": "xxxxxx",
    "token": "xxxxxxxx"
  },
  "Bitbucket": {
    "user": "",
    "token": ""
  },
  "Gitlab": {
    "user": "",
    "token": ""
  }
}

Here is how I configured my token
image

Expected behavior
I was expecting the md to display in the post.
https://github.com/eblabs/eblabs_community/blob/master/docs/RetimeTools/README.md

Screenshots

image

image

Additional context
Please let me know if you need any more info., thanks!!

WordPress Warning when plugin is activated

Versions
Wordpress: 5.4.1
Documents for Git: 1.0.1

Describe the bug
Upon activation, the following errors are displayed in WordPress:
Warning: include_once(../../documents-git.php): failed to open stream: No such file or directory in /home/luigibe2/public_html/DAHelpGuide/wp-content/plugins/documents-from-git/includes/providers/class-base-loader.php on line 3

Warning: include_once(): Failed opening '../../documents-git.php' for inclusion (include_path='.:/usr/local/php73/pear') in /home/luigibe2/public_html/DAHelpGuide/wp-content/plugins/documents-from-git/includes/providers/class-base-loader.php on line 3

Warning: Cannot modify header information - headers already sent by (output started at /home/luigibe2/public_html/DAHelpGuide/wp-content/plugins/documents-from-git/includes/providers/class-base-loader.php:3) in /home/luigibe2/public_html/DAHelpGuide/wp-includes/functions.php on line 6221

Paste the shortcode and the censored contents of config.json
Contents of includes/config.json:
{
"limit": 5,
"classes": "",
"Github": {
"user": "",
"token": ""
},
"Bitbucket": {
"user": "",
"token": ""
},
"Gitlab": {
"user": "",
"token": ""
}
}

To Reproduce
Steps to reproduce the behavior:

  1. Install Plugin
  2. Activate

Screenshots
Screen Shot 2020-04-29 at 11 08 04 PM

Additional context
This was tested across multiple WordPress installations with repeated results.

Thanks for your time!

Doesn't update ipynb when git is updated.

Not sure how this is meant to work.

Install of plugin, and WP pusher went fine. I created a new page, added shortcode for one of the examples,

[git-github-jupyter url="https://github.com/GIScience/openrouteservice-examples/blob/master/python/ortools_pubcrawl.ipynb"]

and it renders fine. If I then change it to one of my notebooks, it changes and renders the new book correctly. I've since made multiple updates over several hours to the file on github that the shortcode is referencing, but no changes show up in the rendered ipynb on wordpress.

Deleting the page, and adding the shortcode to a new page, does not fix this, so I'm guessing it's a caching issue of some sort? There is mention in #20 of static vs dynamic caching being implemented soon. As best I can tell, the suggested workaround for an insufficiently dynamic cache is to adjust the limit or cache_ttl in the config.json. Adjusting these made no change - I dropped limit to 1 and cache_ttl to 6, activated/deactivated the plugin and it's still looking at a version of the notebook that was initially loaded to github several hours ago.

Not sure what else I should be looking for or where to start looking to be able to diagnose/fix this?

Cheers
Ben

Add UI in WP admin page

It would be very helpful if one could set the access tokens and user names via a few UI elements in WP's admin area, so no need to set them on every shortcode, which is a little tedious (and error-prone)..

I'd appreciate help here, as I don't wanna go down that rabbit hole myself 😜

Inline codeblocks not working correctly?

Versions
Wordpress: 5.9.3
Documents for Git: 2.2.0

Describe the bug
It seems that any inline code is converted to a full code block (or at least on my website). This means this:

OfficeIMO Release History

- 0.1.5

  • Fixes TableOfContent.Update()

- 0.1.4 - 2022.04.03

  • First official release

Is translated as:

image

It can be seen here: https://evotec.xyz/docs/officeimo-release-history/

Paste the shortcode and the censored contents of config.json

shortcode

I have no config.json there. Configured only via GUI

To Reproduce
Steps to reproduce the behavior:

  1. Create MD with inline code
  2. Notice it converts inline code to a full code block

Expected behavior

It should just "highlight" the code (more of bold or something)

Screenshots

Additional context

GitLab rate limited

Versions
Wordpress: 5.5.1
Documents for Git: 1.0.2

Describe the bug

I'm getting a response message like if I were using a markdown from github, but I'm using a gitlab link. Besides that, I'm getting rate limited too easily even if I provided a username and a token.

{"message":"API rate limit exceeded for 54.3*.***.209. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)","documentation_url":"https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting"}

Paste the shortcode and the censored contents of config.json

[git-gitlab-markdown url="https://gitlab.com/andrei1058/bedwarsproxy/-/blob/development/README.md"]

{
  "limit": 5,
  "classes": "",
  "Github": {
    "user": "",
    "token": ""
  },
  "Bitbucket": {
    "user": "",
    "token": ""
  },
  "Gitlab": {
    "user": "andrei1058",
    "token": "v5v5*V*V+*V*V**%*%"
  }
}

To Reproduce
Steps to reproduce the behavior:

  1. Create an article with a markdown file
  2. Put your credentials in config.json
  3. Refresh the web page evert 10 seconds for about 5 minutes

Expected behavior

Screenshots

Additional context

plugin does not respect dark mode

Versions
Wordpress: 5.6
Documents for Git: 1.1.0

Describe the bug
The text color is not aware of the dark mode (theme twenty-one) and stays black instead of being white (like the default text does)

Paste the shortcode and the censored contents of config.json
config.json is the default file with github access token.
shortcode

[git-github-markdown url="https://github.com/gis-ops/tutorials/blob/master/qgis/QGIS_SimplePlugin.md"]

To Reproduce
Steps to reproduce the behavior:

  1. Select theme twenty-one
  2. Add shortcode
  3. turn the dark mode on
  4. enjoy not being able to read anything

Expected behavior
The text should turn into a bright color to make it readable on a dark background like it does on github.

Screenshots
Dark mode on:
image

Dark mode off:
image

[feature request] Workaround relative links

It would be great if you could process relative links like [a link](./INSTALL.md) and images to point to the original resource. Specially for images this is really important.

Danke!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.