bwillis / jekyll-github-sample Goto Github PK
View Code? Open in Web Editor NEW:bookmark_tabs: Get a sample of a Github public repo file
:bookmark_tabs: Get a sample of a Github public repo file
I modified my Gemfile and did a bundle
, but now I'm getting the following error whenever I try to jekyll serve
:
/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.5/lib/bundler/rubygems_ext.rb:45:in `full_gem_path': uninitialized constant Bundler::Plugin::API::Source (NameError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:1391:in `contains_requirable_file?'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:68:in `block in require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:823:in `block in each'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:822:in `each'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:822:in `each'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:67:in `find'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:67:in `require'
from /Library/Ruby/Gems/2.0.0/gems/bundler-1.14.5/lib/bundler/plugin/api/source.rb:2:in `<top (required)>'
from /Library/Ruby/Gems/2.0.0/gems/bundler-1.14.5/lib/bundler/rubygems_ext.rb:45:in `full_gem_path'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:1391:in `contains_requirable_file?'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:68:in `block in require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:823:in `block in each'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:822:in `each'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb:822:in `each'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:67:in `find'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:67:in `require'
from /Library/Ruby/Gems/2.0.0/gems/bundler-1.14.5/lib/bundler.rb:12:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:135:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:144:in `require'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-3.4.1/lib/jekyll/plugin_manager.rb:34:in `require_from_bundler'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-3.4.1/exe/jekyll:9:in `<top (required)>'
from /usr/local/bin/jekyll:23:in `load'
from /usr/local/bin/jekyll:23:in `<main>'
Any ideas?
When I add to many github_sample
tag in my markdown files.
It jekyll frequently reported Error: execution expired
.
It would be cool to update this for jekyll 3. Currently getting an error when I try to bundle
jekyll_github_sample was resolved to 0.1.0, which depends on
jekyll (~> 1.0)
Discovered in testing today that the plugin is using Kernel#open instead of
URI#open when retrieving contents from GitHub. Ruby threw the following
deprecation notice:
Jekyll Feed: Generating feed for posts
/home/akale/repository/code/codecommit/kriation/blog/vendor/ruby/2.7.0/gems/jekyll_github_sample-0.3.2/lib/jekyll_github_sample/code_tag.rb:19:
warning: calling URI.open via Kernel#open is deprecated, call URI.open directly
or use URI#open
When trying to run the sample from the main page on Jekyll 3.4.0:
{% github_sample_ref /bwillis/versioncake/989237901cb873f96df12be48cbf1239be496bd7/Appraisals %}
{% highlight ruby %}
{% github_sample /bwillis/versioncake/989237901cb873f96df12be48cbf1239be496bd7/Appraisals 0 5 %}
{% endhighlight %}
It gives:
Liquid Exception: bad value for range in /Users/anatolii/Projects/blog/src/_posts/2017-02-23-test-plugins.md
/Library/Ruby/Gems/2.0.0/gems/jekyll_github_sample-0.3.0/lib/jekyll_github_sample/code_tag.rb:25:in `render': bad value for range (ArgumentError)
from /Library/Ruby/Gems/2.0.0/gems/liquid-3.0.6/lib/liquid/block.rb:151:in `render_token'
from /Library/Ruby/Gems/2.0.0/gems/liquid-3.0.6/lib/liquid/profiler/hooks.rb:5:in `block in render_token_with_profiling'
from /Library/Ruby/Gems/2.0.0/gems/liquid-3.0.6/lib/liquid/profiler.rb:80:in `profile_token_render'
from /Library/Ruby/Gems/2.0.0/gems/liquid-3.0.6/lib/liquid/profiler/hooks.rb:4:in `render_token_with_profiling'
from /Library/Ruby/Gems/2.0.0/gems/liquid-3.0.6/lib/liquid/block.rb:135:in `block in render_all'
from /Library/Ruby/Gems/2.0.0/gems/liquid-3.0.6/lib/liquid/block.rb:122:in `each'
from /Library/Ruby/Gems/2.0.0/gems/liquid-3.0.6/lib/liquid/block.rb:122:in `render_all'
from /Library/Ruby/Gems/2.0.0/gems/liquid-3.0.6/lib/liquid/block.rb:108:in `render'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-3.4.0/lib/jekyll/tags/highlight.rb:32:in `render'
from /Library/Ruby/Gems/2.0.0/gems/liquid-3.0.6/lib/liquid/block.rb:151:in `render_token'
from /Library/Ruby/Gems/2.0.0/gems/liquid-3.0.6/lib/liquid/profiler/hooks.rb:5:in `block in render_token_with_profiling'
from /Library/Ruby/Gems/2.0.0/gems/liquid-3.0.6/lib/liquid/profiler.rb:80:in `profile_token_render'
from /Library/Ruby/Gems/2.0.0/gems/liquid-3.0.6/lib/liquid/profiler/hooks.rb:4:in `render_token_with_profiling'
from /Library/Ruby/Gems/2.0.0/gems/liquid-3.0.6/lib/liquid/block.rb:135:in `block in render_all'
from /Library/Ruby/Gems/2.0.0/gems/liquid-3.0.6/lib/liquid/block.rb:122:in `each'
from /Library/Ruby/Gems/2.0.0/gems/liquid-3.0.6/lib/liquid/block.rb:122:in `render_all'
from /Library/Ruby/Gems/2.0.0/gems/liquid-3.0.6/lib/liquid/block.rb:108:in `render'
from /Library/Ruby/Gems/2.0.0/gems/liquid-3.0.6/lib/liquid/template.rb:210:in `block in render'
from /Library/Ruby/Gems/2.0.0/gems/liquid-3.0.6/lib/liquid/template.rb:262:in `with_profiling'
from /Library/Ruby/Gems/2.0.0/gems/liquid-3.0.6/lib/liquid/template.rb:209:in `render'
from /Library/Ruby/Gems/2.0.0/gems/liquid-3.0.6/lib/liquid/template.rb:222:in `render!'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-3.4.0/lib/jekyll/liquid_renderer/file.rb:28:in `block (2 levels) in render!'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-3.4.0/lib/jekyll/liquid_renderer/file.rb:40:in `measure_bytes'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-3.4.0/lib/jekyll/liquid_renderer/file.rb:27:in `block in render!'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-3.4.0/lib/jekyll/liquid_renderer/file.rb:47:in `measure_time'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-3.4.0/lib/jekyll/liquid_renderer/file.rb:26:in `render!'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-3.4.0/lib/jekyll/renderer.rb:134:in `render_liquid'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-3.4.0/lib/jekyll/renderer.rb:82:in `run'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-3.4.0/lib/jekyll/site.rb:452:in `block (2 levels) in render_docs'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-3.4.0/lib/jekyll/site.rb:450:in `each'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-3.4.0/lib/jekyll/site.rb:450:in `block in render_docs'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-3.4.0/lib/jekyll/site.rb:449:in `each'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-3.4.0/lib/jekyll/site.rb:449:in `render_docs'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-3.4.0/lib/jekyll/site.rb:190:in `render'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-3.4.0/lib/jekyll/site.rb:69:in `process'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-3.4.0/lib/jekyll/command.rb:26:in `process_site'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-3.4.0/lib/jekyll/commands/build.rb:63:in `build'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-3.4.0/lib/jekyll/commands/build.rb:34:in `process'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-3.4.0/lib/jekyll/commands/serve.rb:37:in `block (2 levels) in init_with_program'
from /Library/Ruby/Gems/2.0.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `call'
from /Library/Ruby/Gems/2.0.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
from /Library/Ruby/Gems/2.0.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
from /Library/Ruby/Gems/2.0.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
from /Library/Ruby/Gems/2.0.0/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
from /Library/Ruby/Gems/2.0.0/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-3.4.0/exe/jekyll:13:in `<top (required)>'
from /usr/local/bin/jekyll:23:in `load'
from /usr/local/bin/jekyll:23:in `<main>'
The same project works on Jekyll 2.4.0.
I get the first line indented
### ============ 2. Download =========
### File location defaults to '~/GDCData'
GDCdownload(query = query,
method = "client")
with the line numbers
{% highlight r %}
{% github_sample jvwong/docker_enrichment_workflow_gdc/blob/01442e4397c036c65da74563aa633f45d9a8117d/src/scripts/get_data.R 29 32 %}
{% endhighlight %}
Is it possible to fetch from a local git repo? Or from any git repo in general?
Request for the original commit repo line numbers.
Due to the Jekyll dependency in the gemspec set to ~> 3.0, Jekyll 4 refuses to load this plugin.
I created PR #14 to resolve the dependency and was able to successfully test it in my deployment.
@bwillis when you have a chance, could you create a new release?
Hey,
using the latest version of jekyll-github-sample (v0.3.2
) together with Jekyll v4.2.0
and the setup from the README (the exact same sample usages), I get this error on jekyll build
:
Liquid Exception: No such file or directory @ rb_sysopen - https://raw.githubusercontent.com/bwillis/versioncake/Appraisals/ in /home/..../post.md
bundler: failed to load command: jekyll (/usr/local/lib/ruby/gems/3.0.0/bin/jekyll)
/usr/local/lib/ruby/gems/3.0.0/gems/jekyll_github_sample-0.3.2/lib/jekyll_github_sample/code_tag.rb:19:in `initialize': No such file or directory @ rb_sysopen - https://raw.githubusercontent.com/bwillis/versioncake/Appraisals/ (Errno::ENOENT)
Any hints on what the issue could be? Anyone else getting this as well? :)
I'm in a bit of a pickle; I really want to do something like this:
{% assign readmepath=page.github_repo | append: "/master/README.md" %}
{% capture readme_in_markdown %}{% github_sample readmepath %}{% endcapture %}
{{ readme_in_markdown | markdownify }}
But...github_sample thinks that readmepath is the path I'm talking about. Is there anyway to upgrade this gem so that it handles a variable name or a url string?
People have asked about this stuff before in places like this
I'm trying to store github repos in my frontmatter and then, if extant and valid, fetch the README.md files.
Thanks!
this plugin is freaking amazing cause I can update my page automatically when I update my project readme. saving a lot of time to not update things in 2 different places.
anyways I get an error:
Liquid Exception: Liquid syntax error (line 1): Unknown tag 'github_sample' in projects/king-bot/index.md
I installed the gem, and added it to the plugins (btw. change that in your documentation please :) )
tried to bundle exec Jekyll serve
but no luck at all
implemented like:
{% github_sample scriptworld-git/king-bot/blob/master/README.md 5 %}
also tried:
{%- github_sample scriptworld-git/king-bot/blob/master/README.md 5 -%}
and even full path:
{% github_sample https://github.com/scriptworld-git/king-bot/blob/master/README.md 5 %}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.