From 93559b38b2c02902e51aaf9016b798cf7c5161a6 Mon Sep 17 00:00:00 2001 From: Fuzzwah Date: Tue, 27 Feb 2024 15:14:29 +1100 Subject: [PATCH 01/10] remove python things from dockerfile --- Dockerfile | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index aa0f09aa..2631c9ba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:trusty +FROM ubuntu:focal RUN apt-get update -qq RUN apt-get install -y apt-transport-https @@ -8,7 +8,7 @@ RUN echo "deb https://dl.bintray.com/nxadm/rakudo-pkg-debs `lsb_release -cs` mai RUN apt-get update -qq RUN apt-get install -y \ - perl rakudo-pkg curl git build-essential python python-pip \ + perl rakudo-pkg curl git build-essential \ libssl-dev libreadline-dev zlib1g-dev \ libicu-dev cmake pkg-config @@ -18,12 +18,10 @@ RUN install-zef-as-user && zef install Pod::To::HTML RUN curl -L http://cpanmin.us | perl - App::cpanminus RUN cpanm --installdeps --notest Pod::Simple -RUN pip install docutils - ENV PATH $PATH:/root/.rbenv/bin:/root/.rbenv/shims RUN curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-installer | bash -RUN rbenv install 2.4.1 -RUN rbenv global 2.4.1 +RUN rbenv install 3.3.0 +RUN rbenv global 3.3.0 RUN rbenv rehash RUN gem install bundler @@ -31,7 +29,6 @@ RUN gem install bundler WORKDIR /data/github-markup COPY github-markup.gemspec . COPY Gemfile . -COPY Gemfile.lock . COPY lib/github-markup.rb lib/github-markup.rb RUN bundle From c489cc6bf56469b21e416b24646b39e5e39cf1df Mon Sep 17 00:00:00 2001 From: Fuzzwah Date: Tue, 27 Feb 2024 15:17:37 +1100 Subject: [PATCH 02/10] Update Gemfile don't do the git magic on commonmarker, add pandoc-ruby --- Gemfile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index c98072f2..165529df 100644 --- a/Gemfile +++ b/Gemfile @@ -5,13 +5,12 @@ gem "posix-spawn", :platforms => :ruby gem "redcarpet", :platforms => :ruby gem "kramdown", :platforms => :jruby gem "RedCloth" -# using a tag version here because 0.18.3 was not published by the author to encourage users to upgrade. -# however we want to bump up to this version since this has a security patch -gem "commonmarker", git: "https://github.com/gjtorikian/commonmarker.git", tag: "v0.18.3" +gem "commonmarker", "= 1.0.4" gem "rdoc", "~>3.6" gem "org-ruby", "= 0.9.9" gem "creole", "~>0.3.6" gem "wikicloth", "=0.8.3" gem "twitter-text", "~> 1.14" gem "asciidoctor", "~> 2.0.5" -gem "rake" +gem "rake", "~> 12" +gem "pandoc-ruby", "= 2.1.10" From 24217d1b0d0d2ee235a26c2496db89bb96295bfe Mon Sep 17 00:00:00 2001 From: Fuzzwah Date: Tue, 27 Feb 2024 15:18:01 +1100 Subject: [PATCH 03/10] Delete lib/github/commands/rest2html --- lib/github/commands/rest2html | 314 ---------------------------------- 1 file changed, 314 deletions(-) delete mode 100755 lib/github/commands/rest2html diff --git a/lib/github/commands/rest2html b/lib/github/commands/rest2html deleted file mode 100755 index c7c89dce..00000000 --- a/lib/github/commands/rest2html +++ /dev/null @@ -1,314 +0,0 @@ -#!/usr/bin/env python -""" -rest2html - A small wrapper file for parsing ReST files at GitHub. - -Written in 2008 by Jannis Leidel - -Brandon Keepers -Bryan Veloso -Chris Wanstrath -Dave Abrahams -Garen Torikian -Gasper Zejn -Michael Jones -Sam Whited -Tyler Chung -Vicent Marti - -To the extent possible under law, the author(s) have dedicated all copyright -and related and neighboring rights to this software to the public domain -worldwide. This software is distributed without any warranty. - -You should have received a copy of the CC0 Public Domain Dedication along with -this software. If not, see . -""" - -__author__ = "Jannis Leidel" -__license__ = "CC0" -__version__ = "0.1" - -import sys -import os - -# This fixes docutils failing with unicode parameters to CSV-Table. The -S -# switch and the following 3 lines can be removed after upgrading to python 3. -if sys.version_info[0] < 3: - reload(sys) - sys.setdefaultencoding('utf-8') - -import site - -try: - import locale - locale.setlocale(locale.LC_ALL, '') -except: - pass - -import codecs -import io - -from docutils import nodes, utils -from docutils.parsers.rst import directives, roles -from docutils.parsers.rst.directives.body import CodeBlock, Directive -from docutils.core import publish_parts -from docutils.writers.html4css1 import Writer, HTMLTranslator -from docutils.parsers.rst.states import Body -from docutils import nodes - -# By default, docutils provides two choices for unknown directives: -# - Show errors if the reporting level is high enough -# - Silently do not display them otherwise -# Comments are not displayed, either. - -# This code monkey-patches docutils to show preformatted lines -# in both these cases. - -# Recommended practice for repositories with rst files: -# - If github is the preferred viewer for the rst files (e.g. README.rst), -# then design the files to properly display for github. E.g., do not -# include unknown directives or restructuredText comments. -# - If github is NOT the preferred viewer for the rst files (e.g. -# the files are designed to be used with sphinx extensions at readthedocs) -# then include a restructuredText comment at the top of the file -# explaining that the document will display much more nicely with its -# preferred viewer, e.g. at readthedocs. - -original_behavior = False # Documents original docutils behavior -github_display = True - -def extract_extension_options(field_list, option_spec): - """ - Overrides `utils.extract_extension_options` and inlines - `utils.assemble_option_dict` to make it ignore unknown options passed to - directives (i.e. ``:caption:`` for ``.. code-block:``). - """ - - dropped = set() - options = {} - for name, value in utils.extract_options(field_list): - convertor = option_spec.get(name) - if name in options or name in dropped: - raise utils.DuplicateOptionError('duplicate option "%s"' % name) - - # silently drop unknown options as long as they are not duplicates - if convertor is None: - dropped.add(name) - continue - - # continue as before - try: - options[name] = convertor(value) - except (ValueError, TypeError) as detail: - raise detail.__class__('(option: "%s"; value: %r)\n%s' - % (name, value, ' '.join(detail.args))) - return options - -utils.extract_extension_options = extract_extension_options - -def unknown_directive(self, type_name): - lineno = self.state_machine.abs_line_number() - indented, indent, offset, blank_finish = \ - self.state_machine.get_first_known_indented(0, strip_indent=False) - text = '\n'.join(indented) - if original_behavior: - error = self.reporter.error( - 'Unknown directive type "%s".' % type_name, - nodes.literal_block(text, text), line=lineno) - return [error], blank_finish - elif github_display: - cls = ['unknown_directive'] - result = [nodes.literal_block(text, text, classes=cls)] - return result, blank_finish - else: - return [nodes.comment(text, text)], blank_finish - -def comment(self, match): - if not match.string[match.end():].strip() \ - and self.state_machine.is_next_line_blank(): # an empty comment? - return [nodes.comment()], 1 # "A tiny but practical wart." - indented, indent, offset, blank_finish = \ - self.state_machine.get_first_known_indented(match.end()) - while indented and not indented[-1].strip(): - indented.trim_end() - if not original_behavior: - firstline = ''.join(indented[:1]).split() - if ' '.join(firstline[:2]) == 'github display': - if len(firstline) == 3 and firstline[2] in ('on', 'off'): - global github_display - github_display = firstline[2] == 'on' - if len(indented) == 1: - return [nodes.comment()], 1 - text = '\n'.join(indented[1:]) - cls = ['github_comment'] - result = [nodes.literal_block(text, text, classes=cls)] - return result, blank_finish - text = '\n'.join(indented) - return [nodes.comment(text, text)], blank_finish - -Body.comment = comment -Body.unknown_directive = unknown_directive - - -SETTINGS = { - 'cloak_email_addresses': False, - 'file_insertion_enabled': False, - 'raw_enabled': True, - 'strip_comments': True, - 'doctitle_xform': True, - 'initial_header_level': 2, - 'report_level': 5, - 'syntax_highlight': 'none', - 'math_output': 'latex', - 'field_name_limit': 50, -} - -default_highlight_language = None - -class HighlightDirective(Directive): - required_arguments = 1 - optional_arguments = 1 - option_spec = {} - def run(self): - """Track the default syntax highlighting language - """ - global default_highlight_language - default_highlight_language = self.arguments[0] - return [] - -class DoctestDirective(CodeBlock): - """Render Sphinx 'doctest:: [group]' blocks as 'code:: python' - """ - - def run(self): - """Discard any doctest group argument, render contents as python code - """ - self.arguments = ['python'] - return super(DoctestDirective, self).run() - - -class GitHubHTMLTranslator(HTMLTranslator): - - # removes the
tag wrapped around docs - # see also: http://bit.ly/1exfq2h (warning! sourceforge link.) - def depart_document(self, node): - HTMLTranslator.depart_document(self, node) - self.html_body.pop(0) # pop the starting
off - self.html_body.pop() # pop the ending
off - - # technique for visiting sections, without generating additional divs - # see also: http://bit.ly/NHtyRx - # the a is to support ::contents with ::sectnums: http://git.io/N1yC - def visit_section(self, node): - id_attribute = node.attributes['ids'][0] - self.body.append('\n' % id_attribute) - self.section_level += 1 - - def depart_section(self, node): - self.section_level -= 1 - - def visit_literal_block(self, node): - classes = node.attributes['classes'] - if len(classes) >= 2 and classes[0] == 'code': - language = classes[1] - del classes[:] - self.body.append(self.starttag(node, 'pre', lang=language)) - elif default_highlight_language is not None: - self.body.append(self.starttag(node, 'pre', lang=default_highlight_language)) - else: - self.body.append(self.starttag(node, 'pre')) - - def visit_doctest_block(self, node): - self.body.append(self.starttag(node, 'pre', lang='pycon')) - - # always wrap two-backtick rst inline literals in , not - # this also avoids the generation of superfluous tags - def visit_literal(self, node): - self.body.append(self.starttag(node, 'code', suffix='')) - - def depart_literal(self, node): - self.body.append('') - - def visit_table(self, node): - classes = ' '.join(['docutils', self.settings.table_style]).strip() - self.body.append( - self.starttag(node, 'table', CLASS=classes)) - - def depart_table(self, node): - self.body.append('\n') - - def depart_image(self, node): - uri = node['uri'] - ext = os.path.splitext(uri)[1].lower() - # we need to swap RST's use of `object` with `img` tags - # see http://git.io/5me3dA - if ext == ".svg": - # preserve essential attributes - atts = {} - for attribute, value in node.attributes.items(): - # we have no time for empty values - if value: - if attribute == "uri": - atts['src'] = value - else: - atts[attribute] = value - - # toss off `object` tag - self.body.pop() - # add on `img` with attributes - self.body.append(self.starttag(node, 'img', **atts)) - HTMLTranslator.depart_image(self, node) - - -def kbd(name, rawtext, text, lineno, inliner, options={}, content=[]): - return [nodes.raw('', '%s' % text, format='html')], [] - - -def main(): - """ - Parses the given ReST file or the redirected string input and returns the - HTML body. - - Usage: rest2html < README.rst - rest2html README.rst - """ - try: - text = codecs.open(sys.argv[1], 'r', 'utf-8').read() - except IOError: # given filename could not be found - return '' - except IndexError: # no filename given - if sys.version_info[0] < 3: # python 2.x - text = sys.stdin.read() - else: # python 3 - input_stream = io.TextIOWrapper(sys.stdin.buffer, encoding='utf-8') - text = input_stream.read() - - writer = Writer() - writer.translator_class = GitHubHTMLTranslator - - roles.register_canonical_role('kbd', kbd) - - # Render source code in Sphinx doctest blocks - directives.register_directive('doctest', DoctestDirective) - - # Set default highlight language - directives.register_directive('highlight', HighlightDirective) - - parts = publish_parts(text, writer=writer, settings_overrides=SETTINGS) - if 'html_body' in parts: - html = parts['html_body'] - - # publish_parts() in python 2.x return dict values as Unicode type - # in py3k Unicode is unavailable and values are of str type - if isinstance(html, str): - return html - else: - return html.encode('utf-8') - return '' - -if __name__ == '__main__': - if sys.version_info[0] < 3: # python 2.x - sys.stdout.write("%s%s" % (main(), "\n")) - else: # python 3 - output_stream = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8') - output_stream.write("%s%s" % (main(), "\n")) - sys.stdout.flush() From e4346d813991faee062feb7d97d077e8f806db53 Mon Sep 17 00:00:00 2001 From: Fuzzwah Date: Tue, 27 Feb 2024 15:26:31 +1100 Subject: [PATCH 04/10] use ruby-pandoc rather than python-docutils for rst --- lib/github/markups.rb | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/github/markups.rb b/lib/github/markups.rb index 2c30c99d..df7f4bea 100644 --- a/lib/github/markups.rb +++ b/lib/github/markups.rb @@ -1,6 +1,7 @@ require "github/markup/markdown" require "github/markup/rdoc" require "shellwords" +require 'pandoc-ruby' markup_impl(::GitHub::Markups::MARKUP_MARKDOWN, ::GitHub::Markup::Markdown.new) @@ -47,13 +48,9 @@ Asciidoctor.convert(content, :safe => :secure, :attributes => attributes) end -command( - ::GitHub::Markups::MARKUP_RST, - "python3 #{Shellwords.escape(File.dirname(__FILE__))}/commands/rest2html", - /re?st(\.txt)?/, - ["reStructuredText"], - "restructuredtext" -) +markup(::GitHub::Markups::MARKUP_RST, :rst, /re?st(\.txt)?/, ["reStructuredText"]) do |filename, content, options: {}| + PandocRuby.new(content, from: 'rst').to_html +end command(::GitHub::Markups::MARKUP_POD6, :pod62html, /pod6/, ["Pod 6"], "pod6") command(::GitHub::Markups::MARKUP_POD, :pod2html, /pod/, ["Pod"], "pod") From 323af6a6d23b908fad3bb4fd5a31c65589da6798 Mon Sep 17 00:00:00 2001 From: Fuzzwah Date: Tue, 27 Feb 2024 05:18:49 +0000 Subject: [PATCH 05/10] fixing rakudo --- Dockerfile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2631c9ba..27aed759 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,8 +3,14 @@ FROM ubuntu:focal RUN apt-get update -qq RUN apt-get install -y apt-transport-https -RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 379CE192D401AB61 -RUN echo "deb https://dl.bintray.com/nxadm/rakudo-pkg-debs `lsb_release -cs` main" | tee -a /etc/apt/sources.list.d/rakudo-pkg.list +RUN apt-get install -y \ + locales \ + software-properties-common \ + curl \ + gnupg2 + +RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0DD4CA7EB1C6CC6B +RUN curl -1sLf 'https://dl.cloudsmith.io/public/nxadm-pkgs/rakudo-pkg/config.deb.txt?distro=ubuntu&codename=lunar&component=main' > /etc/apt/sources.list.d/nxadm-pkgs-rakudo-pkg.list RUN apt-get update -qq RUN apt-get install -y \ From 847d66c1c819df49b5f70afa92b90bff546249d8 Mon Sep 17 00:00:00 2001 From: Fuzzwah Date: Tue, 27 Feb 2024 10:59:57 +0000 Subject: [PATCH 06/10] use ruby-build --- Dockerfile | 50 ++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 36 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index 27aed759..fe5fcb7b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,36 +1,58 @@ FROM ubuntu:focal RUN apt-get update -qq -RUN apt-get install -y apt-transport-https - RUN apt-get install -y \ + apt-transport-https \ locales \ software-properties-common \ curl \ gnupg2 -RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0DD4CA7EB1C6CC6B -RUN curl -1sLf 'https://dl.cloudsmith.io/public/nxadm-pkgs/rakudo-pkg/config.deb.txt?distro=ubuntu&codename=lunar&component=main' > /etc/apt/sources.list.d/nxadm-pkgs-rakudo-pkg.list +# add the Raku repository +RUN curl -1sLf 'https://dl.cloudsmith.io/public/nxadm-pkgs/rakudo-pkg/gpg.0DD4CA7EB1C6CC6B.key' | gpg --dearmor >> /usr/share/keyrings/nxadm-pkgs-rakudo-pkg-archive-keyring.gpg +RUN curl -1sLf 'https://dl.cloudsmith.io/public/nxadm-pkgs/rakudo-pkg/config.deb.txt?distro=ubuntu&codename=focal&component=main' > /etc/apt/sources.list.d/nxadm-pkgs-rakudo-pkg.list +# add the Node.js repository +RUN curl -1sLf https://deb.nodesource.com/setup_20.x | bash RUN apt-get update -qq RUN apt-get install -y \ - perl rakudo-pkg curl git build-essential \ - libssl-dev libreadline-dev zlib1g-dev \ - libicu-dev cmake pkg-config + perl \ + rakudo-pkg \ + git \ + libssl-dev \ + libreadline-dev \ + zlib1g-dev \ + libicu-dev \ + cmake \ + build-essential \ + g++ \ + pkg-config \ + nodejs \ + libffi-dev \ + libyaml-dev \ + gcc \ + libxslt-dev \ + libxml2-dev \ + zlib1g-dev ENV PATH $PATH:/opt/rakudo-pkg/bin -RUN install-zef-as-user && zef install Pod::To::HTML +RUN install-zef +ENV PATH $PATH:/root/.raku/bin +RUN zef install Pod::To::HTML2 RUN curl -L http://cpanmin.us | perl - App::cpanminus RUN cpanm --installdeps --notest Pod::Simple +# Install Rbenv and Ruby +RUN git clone https://github.com/rbenv/rbenv.git ~/.rbenv && echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc && echo 'eval "$(rbenv init -)"' >> ~/.bashrc +RUN git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build ENV PATH $PATH:/root/.rbenv/bin:/root/.rbenv/shims -RUN curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-installer | bash -RUN rbenv install 3.3.0 -RUN rbenv global 3.3.0 -RUN rbenv rehash - -RUN gem install bundler +RUN cd /root/.rbenv/plugins/ruby-build && git pull && cd - +ENV RUBY_VERSION 3.3.0 +RUN rbenv install $RUBY_VERSION && rbenv global $RUBY_VERSION && rbenv rehash +RUN echo 'gem: --no-rdoc --no-ri' >> /.gemrc +RUN gem install bundler:2.4.22 +RUN gem install nokogiri --use-system-libraries WORKDIR /data/github-markup COPY github-markup.gemspec . From a077ef41f5e7cb360a0c6071fc3fc2f2abc7ce25 Mon Sep 17 00:00:00 2001 From: Fuzzwah Date: Tue, 27 Feb 2024 11:10:44 +0000 Subject: [PATCH 07/10] nokogiri --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index fe5fcb7b..09af69bc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -52,7 +52,7 @@ ENV RUBY_VERSION 3.3.0 RUN rbenv install $RUBY_VERSION && rbenv global $RUBY_VERSION && rbenv rehash RUN echo 'gem: --no-rdoc --no-ri' >> /.gemrc RUN gem install bundler:2.4.22 -RUN gem install nokogiri --use-system-libraries +RUN gem install nokogiri --platform=ruby -- --use-system-libraries WORKDIR /data/github-markup COPY github-markup.gemspec . From 0e24daa5d0d5675e4cd2c84da8945e439a5fcc04 Mon Sep 17 00:00:00 2001 From: Fuzzwah Date: Tue, 27 Feb 2024 12:22:26 +0000 Subject: [PATCH 08/10] successfully built 4.0.3 --- Dockerfile | 3 ++- Gemfile | 1 + github-markup-4.0.3.gem | Bin 0 -> 6656 bytes github-markup.gemspec | 11 ++++++++++- lib/github-markup.rb | 2 +- 5 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 github-markup-4.0.3.gem diff --git a/Dockerfile b/Dockerfile index 09af69bc..375aa0d7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -52,7 +52,8 @@ ENV RUBY_VERSION 3.3.0 RUN rbenv install $RUBY_VERSION && rbenv global $RUBY_VERSION && rbenv rehash RUN echo 'gem: --no-rdoc --no-ri' >> /.gemrc RUN gem install bundler:2.4.22 -RUN gem install nokogiri --platform=ruby -- --use-system-libraries + +RUN bundle config --global build.nokogiri --use-system-libraries WORKDIR /data/github-markup COPY github-markup.gemspec . diff --git a/Gemfile b/Gemfile index 165529df..59bcee4d 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,7 @@ source "http://rubygems.org" gemspec +gem "nokogiri", force_ruby_platform: true gem "posix-spawn", :platforms => :ruby gem "redcarpet", :platforms => :ruby gem "kramdown", :platforms => :jruby diff --git a/github-markup-4.0.3.gem b/github-markup-4.0.3.gem new file mode 100644 index 0000000000000000000000000000000000000000..c2ff9f9e313a42624af140ce887db6fa68b7aa08 GIT binary patch literal 6656 zcmeHLXHXN$w?{(nM2bM9BUM_c0i}u{9Tg)*=|u=dKtM_a1cOMGAk9z>AcPjs03sj) zQl*zmZvmu8FD8)Zeec8l&wVrReY(E?yzzY5-8s8^%AWbnZx77b-`>gI-(K4FG1)&Q zvOh&ZL4oYg@u&QKlv7kvAd^#2R8j^j$|?Q1PY$f01SaE`{ihuI*Lwr}{Ouq9bScoy z+1c}76@Q!mZ~Fg=?XTeecKqLU$rndMRyZ{6Ob!@Xjd6Ar(`q8e;w&}mA`v@yqo+-1 zv{t?hGo)&&WYpddUGYoX$>Dy6A_>GZo5Wm-EsKH+LLli#Hwk~$B5!naw6-G9eXMDw z@&?r)wC`1^=f|Ej)8kOo5ue;_<8e+|B$E-Pp1^*`^!~|-iKC$x^HIPz&La3Rnl2E!H z6OYFM_dr3upbF7^soTwx+g0mj^w*zd?e4SfY)zwRaC%Yah&xr`QkE+OThx`tA?X@g z#k8Tg@hkVj9j3B!C(BxytQ1I5A0K5#zdMf6-bJy`FF2pY~+4ZFt7F7uu!5_8|7GfIS0j3dDi`)1P2=(sr?m-u#m zaF0II@(>f8{wOl=oORF_xL?2{dr59Bvq+NXbc|!Jv4nK#b8nb`wkNM_KX5X;R5v`l z@_Q}E=m^71#B;5*&F0&wiZkytg_t7{oUh3**>)aLAkZcp<<)PYj`9X^tq7w&3K8bf zm@mUz#ROOsX36&!%fX%}YqPsBW{4KhUx<`nHsD&1)HLVu zx#oX-F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CC*x7#o94*ZV(6AK4jK5)DsM30J@2Q0A!sbz!FE(k6m)_7 zrkvcj0!|p`@RGI^f}A(GuT8K}&PHElVXdbI1IgW|#S4fu1~9zQwpi@W1zGUt zNF3)OxJh5SZ77YMuCOvT5 z(Ox=5A2u~L5bhGZ6<@74;k__b??}jT5b`i~&W!T2d0Wp#mLDm_J3tqiI zR>0;bTrfXUjYpiM2h)qrSAU0yPP_6-M9t7ea*E2RX;p3#?~gatHF<+bq`otrT732C z*wN^BjoH>S!mW5vKXrBMLoIofR?te7-|hl&&VCv8!}89?M#IlilgP-o(gte)?S^j( z=8iuBN{@ z<+gIgjScgx>S%c*y7o%cI+w8&R9>(I#+P%@+?(*3~rmD zokxs6T%nG_)yLVC@d1zSUZ0Pw$F_+9WkV)XqGZn6tKgwbJ#6Q#dTWA%*4XZYqw|-b zs?BHgnYI$^hG>)8~4zA&!)FR0xH%ZPn>}j)?e*W8x{4WvGGQB63+o1 zaz;`)Z6X6K*wUp^rA;hY9o1x!liH{~BeWD}E5bc%Rd2qDceZV0D+&RM+4{3JD>Eco0bEHb~)% z(hvQ5&K|H>J=prg4t~ijG)VHS^mYfy`m|}<5@t)Pp!hi6JjsF^&|z!&kv%~o$|i#* zcPT84Xr>%AHN*Z0Y&=-(j%0qBMRgO?_?dgOGDb1<{xRQAfHwnqMk{*SDJqU_)LKMG3n^1u22uc)@a_`h?KS~Z&{ z4cXq6wtIG$FI)x4fWb!;#P%n}ZQ5ulCDLMr!n_1aV7FBmR_LU2f@3Qfd5oHUH?19G=E zCeBnf10+*-!`!i}_}f9DBWsnoi;zmM2YqhJb?yNpvQQgGD6R4ya_$yLNMT&_3*Km{ lv%3Ft)Q$Z89qPM@6AZ)We#J}tw(&ayzccVV1HU!{{{i%@5 "#{github_link}/issues", + "changelog_uri" => "#{github_link}/releases", + "documentation_uri" => github_link, + "homepage_uri" => s.homepage, + "source_code_uri" => github_link + } + s.files = `git ls-files`.split($\) s.files += Dir['vendor/**/*'] s.executables = s.files.grep(%r{^bin/}).map{ |f| File.basename(f) } diff --git a/lib/github-markup.rb b/lib/github-markup.rb index 58f9b1c5..7262d652 100644 --- a/lib/github-markup.rb +++ b/lib/github-markup.rb @@ -1,6 +1,6 @@ module GitHub module Markup - VERSION = '4.0.2' + VERSION = '4.0.3' Version = VERSION end end From 8a18397737779c414dd527e3097cf2700f15a9c4 Mon Sep 17 00:00:00 2001 From: Fuzzwah Date: Wed, 28 Feb 2024 07:35:19 +0000 Subject: [PATCH 09/10] working pandoc --- Dockerfile | 5 ++- Gemfile | 15 +++---- github-markup-4.0.3.gem | Bin 6656 -> 0 bytes github-markup.gemspec | 73 +++++++++++++++++------------------ lib/github/markup/version.rb | 6 +++ script/bootstrap | 2 +- script/bootstrap.contrib | 3 -- script/cibuild | 2 +- test/markup_test.rb | 1 + 9 files changed, 56 insertions(+), 51 deletions(-) delete mode 100644 github-markup-4.0.3.gem create mode 100644 lib/github/markup/version.rb diff --git a/Dockerfile b/Dockerfile index 375aa0d7..36bd5286 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,7 +33,8 @@ RUN apt-get install -y \ gcc \ libxslt-dev \ libxml2-dev \ - zlib1g-dev + zlib1g-dev \ + libidn11-dev ENV PATH $PATH:/opt/rakudo-pkg/bin RUN install-zef @@ -58,7 +59,7 @@ RUN bundle config --global build.nokogiri --use-system-libraries WORKDIR /data/github-markup COPY github-markup.gemspec . COPY Gemfile . -COPY lib/github-markup.rb lib/github-markup.rb +ADD lib ./lib RUN bundle ENV LC_ALL en_US.UTF-8 diff --git a/Gemfile b/Gemfile index 59bcee4d..efa4c1a0 100644 --- a/Gemfile +++ b/Gemfile @@ -7,11 +7,12 @@ gem "redcarpet", :platforms => :ruby gem "kramdown", :platforms => :jruby gem "RedCloth" gem "commonmarker", "= 1.0.4" -gem "rdoc", "~>3.6" -gem "org-ruby", "= 0.9.9" -gem "creole", "~>0.3.6" +gem 'rdoc', '~> 6.6', '>= 6.6.2' +gem 'org-ruby', '~> 0.9.12' +gem 'creole', '~> 0.5.0' +gem 'idn-ruby', '~> 0.1.5' +gem 'twitter-text', '~> 3.1' gem "wikicloth", "=0.8.3" -gem "twitter-text", "~> 1.14" -gem "asciidoctor", "~> 2.0.5" -gem "rake", "~> 12" -gem "pandoc-ruby", "= 2.1.10" +gem 'asciidoctor', '~> 2.0', '>= 2.0.21' +gem 'rake', '~> 13.1' +gem 'pandoc-ruby', '~> 2.1', '>= 2.1.10' diff --git a/github-markup-4.0.3.gem b/github-markup-4.0.3.gem deleted file mode 100644 index c2ff9f9e313a42624af140ce887db6fa68b7aa08..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6656 zcmeHLXHXN$w?{(nM2bM9BUM_c0i}u{9Tg)*=|u=dKtM_a1cOMGAk9z>AcPjs03sj) zQl*zmZvmu8FD8)Zeec8l&wVrReY(E?yzzY5-8s8^%AWbnZx77b-`>gI-(K4FG1)&Q zvOh&ZL4oYg@u&QKlv7kvAd^#2R8j^j$|?Q1PY$f01SaE`{ihuI*Lwr}{Ouq9bScoy z+1c}76@Q!mZ~Fg=?XTeecKqLU$rndMRyZ{6Ob!@Xjd6Ar(`q8e;w&}mA`v@yqo+-1 zv{t?hGo)&&WYpddUGYoX$>Dy6A_>GZo5Wm-EsKH+LLli#Hwk~$B5!naw6-G9eXMDw z@&?r)wC`1^=f|Ej)8kOo5ue;_<8e+|B$E-Pp1^*`^!~|-iKC$x^HIPz&La3Rnl2E!H z6OYFM_dr3upbF7^soTwx+g0mj^w*zd?e4SfY)zwRaC%Yah&xr`QkE+OThx`tA?X@g z#k8Tg@hkVj9j3B!C(BxytQ1I5A0K5#zdMf6-bJy`FF2pY~+4ZFt7F7uu!5_8|7GfIS0j3dDi`)1P2=(sr?m-u#m zaF0II@(>f8{wOl=oORF_xL?2{dr59Bvq+NXbc|!Jv4nK#b8nb`wkNM_KX5X;R5v`l z@_Q}E=m^71#B;5*&F0&wiZkytg_t7{oUh3**>)aLAkZcp<<)PYj`9X^tq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homepage, - "source_code_uri" => github_link +# frozen_string_literal: true + +require_relative "lib/github/markup/version" + +Gem::Specification.new do |spec| + spec.name = "github-markup" + spec.version = GitHub::Markup::VERSION + spec.homepage = "https://github.com/github/markup" + spec.summary = "The code GitHub uses to render README.markup" + spec.description = <<~DESC + This gem is used by GitHub to render any fancy markup such as Markdown, + Textile, Org-Mode, etc. Fork it and add your own! +DESC + spec.authors = ["Chris Wanstrath", "Rob Crouch"] + spec.license = "MIT" + + spec.metadata = { + "bug_tracker_uri" => "https://github.com/github/markup/issues", + "source_code_uri" => "https://github.com/github/markup" } - s.files = `git ls-files`.split($\) - s.files += Dir['vendor/**/*'] - s.executables = s.files.grep(%r{^bin/}).map{ |f| File.basename(f) } - s.test_files = s.files.grep(%r{^(test|spec|features)/}) - s.require_paths = %w[lib] - - s.add_development_dependency 'rake', '~> 12' - s.add_development_dependency 'activesupport', '~> 4.0' - s.add_development_dependency 'minitest', '~> 5.4', '>= 5.4.3' - s.add_development_dependency 'html-pipeline', '~> 1.0' - s.add_development_dependency 'sanitize', '>= 4.6.3' - s.add_development_dependency 'nokogiri', '~> 1.8.1' - s.add_development_dependency 'nokogiri-diff', '~> 0.2.0' - s.add_development_dependency "github-linguist", ">= 7.1.3" -end + spec.required_ruby_version = ">= 3.2.3" + + spec.files = Dir.glob("lib/**/*", File::FNM_DOTMATCH) + spec.executables = spec.files.grep(%r{^bin/}).map{ |f| File.basename(f) } + spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) + + spec.add_development_dependency 'rake', '~> 13.1' + spec.add_development_dependency 'activesupport', '~> 7.1', '>= 7.1.3.2' + spec.add_development_dependency 'minitest', '~> 5.4', '>= 5.4.3' + spec.add_development_dependency 'html-pipeline', '~> 1.0' + spec.add_development_dependency "sanitize", "~> 4.6", ">= 4.6.3" + spec.add_development_dependency 'nokogiri', '~> 1.8.1' + spec.add_development_dependency 'nokogiri-diff', '~> 0.2.0' + spec.add_development_dependency "github-linguist", "~> 7.1", ">= 7.1.3" + + +end \ No newline at end of file diff --git a/lib/github/markup/version.rb b/lib/github/markup/version.rb new file mode 100644 index 00000000..98a2d3e3 --- /dev/null +++ b/lib/github/markup/version.rb @@ -0,0 +1,6 @@ +module GitHub + module Markup + VERSION = '4.0.3' + Version = VERSION + end +end \ No newline at end of file diff --git a/script/bootstrap b/script/bootstrap index f89f3181..6b87f215 100755 --- a/script/bootstrap +++ b/script/bootstrap @@ -5,4 +5,4 @@ set -e cd $(dirname "$0")/.. bundle install -pip3 install docutils + diff --git a/script/bootstrap.contrib b/script/bootstrap.contrib index 834b6b61..3c0a38bd 100755 --- a/script/bootstrap.contrib +++ b/script/bootstrap.contrib @@ -5,11 +5,8 @@ set -e cd $(dirname "$0")/.. bundle install --path vendor/bundle -virtualenv vendor/python && source vendor/python/bin/activate -pip install docutils echo "" echo "*** DONE ***" echo "" -echo "activate python environment with 'source vendor/python/bin/activate'" echo "run tests with 'bundle exec rake'" diff --git a/script/cibuild b/script/cibuild index 33251773..6d6fd2b5 100755 --- a/script/cibuild +++ b/script/cibuild @@ -10,7 +10,7 @@ export RUBY_HEAP_SLOTS_INCREMENT=400000 export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1 export PATH="/usr/share/rbenv/shims:$PATH" -export RBENV_VERSION="1.9.3" +export RBENV_VERSION="3.3.0" # bootstrap gem environment changes echo "Bootstrapping gem environment ..." diff --git a/test/markup_test.rb b/test/markup_test.rb index 24e78000..bd296ff7 100644 --- a/test/markup_test.rb +++ b/test/markup_test.rb @@ -5,6 +5,7 @@ require 'github/markup' require 'minitest/autorun' require 'html/pipeline' +require 'sanitize' require 'nokogiri' require 'nokogiri/diff' From cba07935dba1ce24f57a4a82480a1a3daf022d3a Mon Sep 17 00:00:00 2001 From: Fuzzwah Date: Wed, 28 Feb 2024 07:46:47 +0000 Subject: [PATCH 10/10] allow ruby > 2.4 --- github-markup.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github-markup.gemspec b/github-markup.gemspec index fd5ad570..e4da71d2 100644 --- a/github-markup.gemspec +++ b/github-markup.gemspec @@ -19,7 +19,7 @@ DESC "source_code_uri" => "https://github.com/github/markup" } - spec.required_ruby_version = ">= 3.2.3" + spec.required_ruby_version = ">= 2.4" spec.files = Dir.glob("lib/**/*", File::FNM_DOTMATCH) spec.executables = spec.files.grep(%r{^bin/}).map{ |f| File.basename(f) }