latex-decode 0.4.2 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: latex-decode
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sylvester Keil
@@ -10,33 +10,16 @@ cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies: []
12
12
  description: Decodes strings formatted in LaTeX to equivalent Unicode strings.
13
+ email:
14
+ - sylvester@keil.or.at
13
15
  executables: []
14
16
  extensions: []
15
17
  extra_rdoc_files:
16
18
  - LICENSE
17
19
  - README.md
18
20
  files:
19
- - ".github/workflows/ci.yml"
20
- - ".gitignore"
21
- - ".simplecov"
22
- - Gemfile
23
21
  - LICENSE
24
22
  - README.md
25
- - Rakefile
26
- - cucumber.yml
27
- - features/brackets.feature
28
- - features/diacritics.feature
29
- - features/greek.feature
30
- - features/maths.feature
31
- - features/non-latex.feature
32
- - features/punctuation.feature
33
- - features/special_characters.feature
34
- - features/step_definitions/latex.rb
35
- - features/support/env.rb
36
- - features/symbols.feature
37
- - features/umlauts.feature
38
- - features/whitespace.feature
39
- - latex-decode.gemspec
40
23
  - lib/latex/decode.rb
41
24
  - lib/latex/decode/accents.rb
42
25
  - lib/latex/decode/base.rb
@@ -47,44 +30,34 @@ files:
47
30
  - lib/latex/decode/punctuation.rb
48
31
  - lib/latex/decode/symbols.rb
49
32
  - lib/latex/decode/version.rb
50
- homepage: http://github.com/inukshuk/latex-decode
33
+ homepage: https://github.com/inukshuk/latex-decode
51
34
  licenses:
52
35
  - GPL-3.0-or-later
53
- metadata: {}
36
+ metadata:
37
+ source_code_uri: https://github.com/inukshuk/latex-decode
38
+ bug_tracker_uri: https://github.com/inukshuk/latex-decode/issues
39
+ changelog_uri: https://github.com/inukshuk/latex-decode/blob/main/CHANGELOG.md
40
+ rubygems_mfa_required: 'true'
54
41
  rdoc_options:
55
42
  - "--line-numbers"
56
- - "--inline-source"
57
43
  - "--title"
58
- - '"LaTeX-Decode Documentation"'
44
+ - LaTeX::Decode
59
45
  - "--main"
60
46
  - README.md
61
- - "--webcvs=http://github.com/inukshuk/latex-decode/tree/master/"
62
47
  require_paths:
63
48
  - lib
64
49
  required_ruby_version: !ruby/object:Gem::Requirement
65
50
  requirements:
66
51
  - - ">="
67
52
  - !ruby/object:Gem::Version
68
- version: '1.8'
53
+ version: '3.3'
69
54
  required_rubygems_version: !ruby/object:Gem::Requirement
70
55
  requirements:
71
56
  - - ">="
72
57
  - !ruby/object:Gem::Version
73
58
  version: '0'
74
59
  requirements: []
75
- rubygems_version: 4.0.3
60
+ rubygems_version: 4.0.24
76
61
  specification_version: 4
77
62
  summary: Decodes LaTeX to Unicode.
78
- test_files:
79
- - features/brackets.feature
80
- - features/diacritics.feature
81
- - features/greek.feature
82
- - features/maths.feature
83
- - features/non-latex.feature
84
- - features/punctuation.feature
85
- - features/special_characters.feature
86
- - features/step_definitions/latex.rb
87
- - features/support/env.rb
88
- - features/symbols.feature
89
- - features/umlauts.feature
90
- - features/whitespace.feature
63
+ test_files: []
@@ -1,34 +0,0 @@
1
- name: ci
2
- on:
3
- push:
4
- branches: [ main ]
5
- pull_request:
6
- branches: [ main ]
7
- jobs:
8
- build:
9
- environment: CI
10
- runs-on: ubuntu-latest
11
-
12
- strategy:
13
- matrix:
14
- ruby-version:
15
- - '3.4'
16
- - '3.3'
17
- - '3.2'
18
- - 'jruby'
19
- steps:
20
- - name: Git checkout
21
- uses: actions/checkout@v4
22
- - name: Setup Ruby
23
- uses: ruby/setup-ruby@v1
24
- with:
25
- ruby-version: ${{ matrix.ruby-version }}
26
- bundler-cache: true
27
- - name: Run tests
28
- run: bundle exec rake
29
- - name: Upload coverage results
30
- if: matrix.ruby-version == '3.3'
31
- continue-on-error: true
32
- uses: coverallsapp/github-action@v2
33
- with:
34
- github-token: ${{ github.token }}
data/.gitignore DELETED
@@ -1,7 +0,0 @@
1
- Gemfile.lock
2
- .ruby-version
3
- .rbx
4
- .ruby-version
5
- *swp
6
- .bundle
7
- coverage
data/.simplecov DELETED
@@ -1,18 +0,0 @@
1
- require 'simplecov-lcov'
2
-
3
- SimpleCov::Formatter::LcovFormatter.config do |c|
4
- c.output_directory = 'coverage'
5
- c.lcov_file_name = 'lcov.info'
6
- c.report_with_single_file = true
7
- end
8
-
9
- SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
10
- SimpleCov::Formatter::HTMLFormatter,
11
- SimpleCov::Formatter::LcovFormatter
12
- ])
13
-
14
- SimpleCov.start do
15
- add_filter 'features/'
16
-
17
- enable_coverage :branch
18
- end
data/Gemfile DELETED
@@ -1,16 +0,0 @@
1
- source 'https://rubygems.org'
2
- gemspec
3
-
4
- group :test do
5
- gem 'rake'
6
- gem 'rspec'
7
- gem 'cucumber'
8
- gem 'simplecov', platform: 'mri'
9
- gem 'simplecov-lcov', platform: 'mri'
10
- end
11
-
12
- group :debug do
13
- gem 'debug', platform: 'mri'
14
- end
15
-
16
- gem 'ritex', '~> 1.0.1'
data/Rakefile DELETED
@@ -1,38 +0,0 @@
1
- # encoding: utf-8
2
-
3
- require 'bundler'
4
- begin
5
- Bundler.setup
6
- rescue Bundler::BundlerError => e
7
- $stderr.puts e.message
8
- $stderr.puts "Run `bundle install` to install missing gems"
9
- exit e.status_code
10
- end
11
-
12
- $:.unshift(File.join(File.dirname(__FILE__), './lib'))
13
- require 'latex/decode/version'
14
-
15
-
16
- desc 'Run an IRB session with LaTeX-Decode loaded'
17
- task :console, [:script] do |t,args|
18
- ARGV.clear
19
-
20
- require 'irb'
21
- require 'latex/decode'
22
-
23
- IRB.conf[:SCRIPT] = args.script
24
- IRB.start
25
- end
26
-
27
- require 'cucumber/rake/task'
28
- Cucumber::Rake::Task.new(:cucumber)
29
-
30
- task :release do |t|
31
- system "gem build latex-decode.gemspec"
32
- system "git tag v#{LaTeX::Decode::VERSION}"
33
- system "git push --tags"
34
- system "gem push latex-decode-#{LaTeX::Decode::VERSION}.gem"
35
- system "rm latex-decode-#{LaTeX::Decode::VERSION}.gem"
36
- end
37
-
38
- task :default => :cucumber
data/cucumber.yml DELETED
@@ -1 +0,0 @@
1
- default: --format progress --require features --color --publish-quiet
@@ -1,11 +0,0 @@
1
- Feature: Decode LaTeX umlauts
2
- As a hacker who works with LaTeX
3
- I want to be able to remove brackets around single characters
4
-
5
- Scenario: Single character in curly brackets
6
- When I decode the string '{a}'
7
- Then the result should be 'a'
8
-
9
- Scenario: German umlauts in curly brackets
10
- When I decode the string '{\"A}{\"o}{\"u}'
11
- Then the result should be 'Äöü'
@@ -1,40 +0,0 @@
1
- Feature: Decode LaTeX diacritics
2
- As a hacker who works with LaTeX
3
- I want to be able to decode LaTeX diacritics
4
-
5
- Scenario Outline: LaTeX to Unicode transformation
6
- When I decode the string '<latex>'
7
- Then the result should be '<unicode>'
8
-
9
- Scenarios: Diacritics
10
- | latex | unicode | description |
11
- | \\\`{o} | ò | grave accent |
12
- | \\\'{o} | ó | acute accent |
13
- | \\^{o} | ô | circumflex |
14
- | \\"{o} | ö | umlaut or dieresis |
15
- | \\H{o} | ő | long Hungarian umlaut (double acute) |
16
- | \\~{o} | õ | tilde |
17
- | \\c{c} | ç | cedilla |
18
- | \\c c | ç | |
19
- | \\c cb | çb | |
20
- | \\c {cb}| \\c cb | |
21
- | \\c C | Ç | |
22
- | {\\c c} | ç | |
23
- | \\k{a} | ą | ogonek |
24
- | \\l | ł | l with stroke |
25
- | \\L | Ł | l with stroke |
26
- | \\={o} | ō | macron accent (a bar over the letter) |
27
- | \\b{o} | o̱ | bar under the letter |
28
- | \\.{o} | ȯ | dot over the letter |
29
- | \\d{u} | ụ | dot under the letter |
30
- | \\r{a} | å | ring over the letter |
31
- | \\u{o} | ŏ | breve over the letter |
32
- | \\v{s} | š | caron/hacek ("v") over the letter |
33
- | \\t{oo} | o͡o | "tie" (inverted u) over the two letters |
34
- | \\aa | å | ring over the letter a |
35
- | \\AA | Å | ring over the letter A |
36
- | \\o | ø | slashed o |
37
- | \\O | Ø | slashed O |
38
- | \\ae | æ | ae |
39
- | \\AE | Æ | AE |
40
-
@@ -1,13 +0,0 @@
1
- Feature: Decode LaTeX Greek Letters
2
- As a hacker who works with LaTeX
3
- I want to be able to decode Greek letters
4
-
5
- Scenario Outline: LaTeX to Unicode transformation
6
- When I decode the string '<latex>'
7
- Then the result should be '<unicode>'
8
-
9
- Scenarios: Greek
10
- | latex | unicode |
11
- | \\alpha | α |
12
- | \\lambda | λ |
13
- | \\Lambda | Λ |
@@ -1,9 +0,0 @@
1
- # Feature: Convert LaTeX maths to MathML
2
- # As a maths-inclined hacker who works with LaTeX
3
- # I want to convert LaTeX maths to MathML
4
- #
5
- # Scenario: Inline maths environment
6
- # When I decode the string '$I_{S}A$'
7
- # Then the result should be '<msub><mi>I</mi><mrow><mi>S</mi></mrow></msub><mi>A</mi>'
8
- # When I decode the string '\underline{firstName LastName$3^g$}'
9
- # Then the result should be ''
@@ -1,15 +0,0 @@
1
- Feature: Keep non-LaTeX markup as it is
2
- As a hacker who works with LaTeX
3
- I want to preserve non-LaTeX text as it is
4
-
5
- Scenario: Standalone escape characters
6
- When I decode the string '\\'
7
- Then the result should be '\\'
8
-
9
- Scenario: Common markup in Regular Expressions
10
- When I decode the string '.*'
11
- Then the result should be '.*'
12
- When I decode the string '^x$'
13
- Then the result should be '^x$'
14
- When I decode the string '\\\\2'
15
- Then the result should be '\\\\2'
@@ -1,50 +0,0 @@
1
- Feature: Decode LaTeX punctuation directives
2
- As a hacker who works with LaTeX
3
- I want to be able to decode LaTeX punctuation marks
4
-
5
- Scenario Outline: LaTeX to Unicode transformation
6
- When I decode the string '<latex>'
7
- Then the result should be '<unicode>'
8
-
9
- Scenarios: Punctuation macros
10
- | latex | unicode |
11
- | \\textendash | – |
12
- | \\textemdash | — |
13
- | \\textquoteleft | ‘ |
14
- | \\textquoteright | ’ |
15
- | \\quotesinglbase | ‚ |
16
- | \\textquotedblleft | “ |
17
- | \\textquotedblright | ” |
18
- | \\quotedblbase | „ |
19
- | \\dag | † |
20
- | \\ddag | ‡ |
21
- | \\textbullet | • |
22
- | \\dots | … |
23
- | \\textperthousand | ‰ |
24
- | \\textpertenthousand | ‱ |
25
- | \\guilsinglleft | ‹ |
26
- | \\guilsinglright | › |
27
- | \\textreferencemark | ※ |
28
- | \\textinterrobang | ‽ |
29
- | \\textoverline | ‾ |
30
- | \\langle | ⟨ |
31
- | \\rangle | ⟩ |
32
- | \\textquotesingle | ’ |
33
-
34
-
35
- Scenarios: Punctuation symbols
36
- | latex | unicode | description |
37
- | - | - | hyphen |
38
- | -- | – | en-dash |
39
- | --- | — | em-dash |
40
- | \\~{} | ~ | tilde |
41
- | \\textasciitilde{} | ~ | tilde |
42
- | \\textasciitilde | ~ | tilde |
43
- | X\\ X | X X | space |
44
-
45
- Scenarios: Quotation marks
46
- | latex | unicode | description |
47
- | `` | “ | left double quotes |
48
- | '' | ” | right double quotes |
49
- | ` | ‘ | left single quotes |
50
- | ' | ’ | right single quotes |
@@ -1,21 +0,0 @@
1
- Feature: Decode LaTeX special characters
2
- As a hacker who works with LaTeX
3
- I want to be able to decode a few special characters which are escaped by LaTeX
4
-
5
- Scenario Outline: LaTeX to Unicode transformation
6
- When I decode the string '<latex>'
7
- Then the result should be '<unicode>'
8
-
9
- Scenarios: Special characters
10
- | latex | unicode |
11
- | \\\& | & |
12
- | \\# | # |
13
- | \\$ | $ |
14
- | \\; | ; |
15
- | \\% | % |
16
- | \\{ | { |
17
- | \\} | } |
18
- | \\_ | _ |
19
- | \\textasciitilde{} | ~ |
20
- | \\textbackslash{} | \\ |
21
- | \\textasciicircum{} | ^ |
@@ -1,12 +0,0 @@
1
- When /^I decode the string ('|")(.*)\1$/ do |quote,string|
2
- @result = LaTeX.decode(string)
3
- end
4
-
5
- Then /^the result should be ('|")(.*)\1$/ do |quote,value|
6
- expect(@result).to eq(value)
7
- end
8
-
9
- # For whitespace or other characters that are hard to read in source code:
10
- Then /^I should get '([^']*)' \+ U\+(\h{4,}) \+ '([^']*)'$/ do |pre,code,post|
11
- expect(@result).to eq(pre + code.hex.chr(Encoding::UTF_8) + post)
12
- end
@@ -1,13 +0,0 @@
1
- begin
2
- require 'simplecov'
3
- rescue LoadError
4
- # ignore
5
- end
6
-
7
- begin
8
- require 'debug'
9
- rescue LoadError
10
- # ignore
11
- end
12
-
13
- require 'latex/decode'
@@ -1,14 +0,0 @@
1
- Feature: Decode LaTeX symbol directives
2
- As a hacker who works with LaTeX
3
- I want to be able to decode LaTeX symbol directives
4
-
5
- Scenario Outline: LaTeX to Unicode transformation
6
- When I decode the string '<latex>'
7
- Then the result should be '<unicode>'
8
-
9
- Scenarios: Arrows
10
- | latex | unicode |
11
- | \\leftarrow | ← |
12
- | \\uparrow | ↑ |
13
- | \\downarrow | ↓ |
14
- | \\rightarrow | → |
@@ -1,11 +0,0 @@
1
- Feature: Decode LaTeX umlauts
2
- As a hacker who works with LaTeX
3
- I want to be able to decode LaTeX umlauts
4
-
5
- Scenario: Lowercase german umlauts
6
- When I decode the string '\"a\"o\"u'
7
- Then the result should be 'äöü'
8
-
9
- Scenario: Uppercase german umlauts
10
- When I decode the string '\"A\"O\"U'
11
- Then the result should be 'ÄÖÜ'
@@ -1,28 +0,0 @@
1
- Feature: Decode LaTeX whitespace directives
2
- As a hacker who works with LaTeX
3
- I want to be able to decode LaTeX whitespace
4
-
5
- Scenario Outline: LaTeX to Unicode transformation
6
- When I decode the string '<latex>'
7
- Then I should get <pre> + U+<code> + <post>
8
-
9
- Scenarios: Whitespace
10
- | latex | pre | code | post | description |
11
- | x~x | 'x' | 00A0 | 'x' | non-breaking space |
12
- | ~y | '' | 00A0 | 'y' | leading non-breaking space |
13
- | z\\,z | 'z' | 202F | 'z' | narrow no-break space |
14
-
15
- # In LaTeX, `\,` produces a kern that is ⅙ em wide. A kern is a
16
- # non-breaking space that is not subject to compression or expansion when
17
- # determining optimal line breaks. The ideal representation might be a
18
- # non-breaking variant of U+2006 Six-Per-Em Space, but the best option
19
- # that exists seems to be U+202F Narrow No-Break Space. While U+202F
20
- # doesn't have an explicit width, Unicode Standard Annex #14, “Unicode
21
- # Line Breaking Algorithm,” revision 47, says:
22
- #
23
- # > When expanding or compressing interword space according to common
24
- # > typographical practice, only the spaces marked by U+0020 SPACE and
25
- # > U+00A0 NO-BREAK SPACE are subject to compression, and only spaces
26
- # > marked by U+0020 SPACE, U+00A0 NO-BREAK SPACE, and occasionally spaces
27
- # > marked by U+2009 THIN SPACE are subject to expansion. All other space
28
- # > characters normally have fixed width.
data/latex-decode.gemspec DELETED
@@ -1,27 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
- lib = File.expand_path('../lib/', __FILE__)
3
- $:.unshift lib unless $:.include?(lib)
4
-
5
- require 'latex/decode/version'
6
-
7
- Gem::Specification.new do |s|
8
- s.name = 'latex-decode'
9
- s.version = LaTeX::Decode::VERSION.dup
10
- s.authors = ['Sylvester Keil']
11
- s.homepage = 'http://github.com/inukshuk/latex-decode'
12
- s.summary = 'Decodes LaTeX to Unicode.'
13
- s.description = 'Decodes strings formatted in LaTeX to equivalent Unicode strings.'
14
- s.license = 'GPL-3.0-or-later'
15
- s.platform = 'ruby'
16
- s.required_ruby_version = '>= 1.8'
17
-
18
- s.files = `git ls-files`.split("\n")
19
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
20
- s.executables = []
21
- s.require_path = 'lib'
22
-
23
- s.rdoc_options = %w{--line-numbers --inline-source --title "LaTeX-Decode\ Documentation" --main README.md --webcvs=http://github.com/inukshuk/latex-decode/tree/master/}
24
- s.extra_rdoc_files = %w{README.md LICENSE}
25
- end
26
-
27
- # vim: syntax=ruby