Giter Site home page Giter Site logo

repositext's People

Contributors

aaronjwalker avatar gettalong avatar jhund avatar lilith avatar ranstang94 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

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

repositext's Issues

Implement an IDML story file converter

The IDML story file converter should do the reverse of the IDML story file parser: It should generate an XML file that can be placed into an IDML file's Stories/ directory. Combining the generated story file with a (probably pre-built and correctly adjusted) IDML file is the job of another class.

  • Find out what the mandatory elements in an IDML story file are (see the IDML spec)
  • CSS class name to applied paragraph/character style mapping should be configurable
  • implement the IDML file writer class

kramdown gemfile branch?

gem 'kramdown', :path => '../kramdown' # NOTE: You need to check out the 'gemfile' branch to make it work.

I don't see a gemfile branch in imazen/kramdown..

rake failure

AaronW-MBP:repositext-kramdown aaron$ bundle exec rake
/Users/aaron/.rbenv/versions/2.0.0-p353/bin/ruby -I"lib:lib:spec" -I"/Users/aaron/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib" "/Users/aaron/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib/rake/rake_test_loader.rb" "spec/*_/__spec.rb"
Run options: --seed 57438

Running:

....................................................................EF.......................................................

Finished in 0.088171s, 1417.6997 runs/s, 1463.0661 assertions/s.

  1. Error:
    Kramdown::ElementRt::#replace_with#test_0001_replaces self with other:
    NoMethodError: undefined method any?' for <kd:text "text2" nil>:Kramdown::ElementRt /Users/aaron/Documents/repositext/repositext-kramdown/lib/kramdown/element_rt.rb:117:inreplace_with'
    /Users/aaron/Documents/repositext/repositext-kramdown/spec/kramdown/element_rt_spec.rb:262:in `block (3 levels) in <top (required)>'

  2. Failure:
    Kramdown::ElementRt::#replace_with#test_0002_raises if you try to replace self with self [/Users/aaron/Documents/repositext/repositext-kramdown/spec/kramdown/element_rt_spec.rb:270]:
    [ArgumentError] exception expected, not
    Class:
    Message: <"undefined method any?' for <kd:text \"text1\" nil>:Kramdown::ElementRt"> ---Backtrace--- /Users/aaron/Documents/repositext/repositext-kramdown/lib/kramdown/element_rt.rb:117:inreplace_with'

/Users/aaron/Documents/repositext/repositext-kramdown/spec/kramdown/element_rt_spec.rb:270:in `block (4 levels) in <top (required)>'

125 runs, 129 assertions, 1 failures, 1 errors, 0 skips
rake aborted!
Command failed with status (1): [ruby -I"lib:lib:spec" -I"/Users/aaron/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib" "/Users/aaron/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib/rake/rake_test_loader.rb" "spec/*_/__spec.rb" ]

Tasks: TOP => default => test
(See full trace by running task with --trace)

Adding location/position information to kramdown parser

@gettalong we would like to add location/position information to the kramdown parser for validation purposes, so that we can include line numbers when reporting validation issues with kramdown documents.

In your opinion, what's the best way to go about this, both technically and resource-wise?

[No paragraph style]

Didn't the idml converter used to error if [No paragraph style] existed?

It is not erroring now. None of the Question paragraph styles in ENG63-1226 had a paragraph style applied. I fixed the original file and imported it again.

Markdown/Kramdown Header Style difference

In Marku, this works:

## location ##  {: .location}

And presumably

## location  {:.location}

In At-Kramdown, it only works like this:

## location
{: .location}

Intentional? Or bug?

LoadError: cannot load such file -- stringex/unidecoder

Even after gem install tidy, gem install unidecoder, gem install coderay, I'm still getting 6 errors running the unit tests on Kramdown:

test_/Users/nathanael/Documents/repositext/kramdown/test/testcases/block/04_header/with_auto_ids_text_to_kramdown_to_html(TestFiles)
LoadError: cannot load such file -- stringex/unidecoder
/Users/nathanael/.rbenv/versions/2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:51:in require' /Users/nathanael/.rbenv/versions/2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:51:inrequire'
/Users/nathanael/Documents/repositext/kramdown/lib/kramdown/utils/unidecoder.rb:24:in <module:Unidecoder>' /Users/nathanael/Documents/repositext/kramdown/lib/kramdown/utils/unidecoder.rb:16:inmodule:Utils'
/Users/nathanael/Documents/repositext/kramdown/lib/kramdown/utils/unidecoder.rb:13:in <module:Kramdown>' /Users/nathanael/Documents/repositext/kramdown/lib/kramdown/utils/unidecoder.rb:12:in<top (required)>'
/Users/nathanael/Documents/repositext/kramdown/lib/kramdown/converter/base.rb:156:in generate_id' /Users/nathanael/Documents/repositext/kramdown/lib/kramdown/converter/html.rb:137:inconvert_header'
/Users/nathanael/Documents/repositext/kramdown/lib/kramdown/converter/html.rb:78:in block in inner' /Users/nathanael/Documents/repositext/kramdown/lib/kramdown/converter/html.rb:77:ineach'
/Users/nathanael/Documents/repositext/kramdown/lib/kramdown/converter/html.rb:77:in inner' /Users/nathanael/Documents/repositext/kramdown/lib/kramdown/converter/html.rb:332:inconvert_root'
/Users/nathanael/Documents/repositext/kramdown/lib/kramdown/converter/html.rb:65:in convert' /Users/nathanael/Documents/repositext/kramdown/lib/kramdown/converter/base.rb:79:inconvert'
/Users/nathanael/Documents/repositext/kramdown/lib/kramdown/document.rb:120:in method_missing' /Users/nathanael/Documents/repositext/kramdown/test/test_files.rb:134:inblock (2 levels) in class:TestFiles'

How to specify ruby version: Gemfile vs. .ruby-version

Currently we have a mix of both approaches.

I noticed one difference: The Gemfile approach does not allow specification of patch level.

If we want to specify patch level, we should use .ruby-version.

Question: is .ruby-version compatible with rbenv?

Allow customization of paragraph style mapping

There is currently a fixed mapping from paragraph styles to class names. This mapping should be customizable.

Note that some post-parsing-transformations are done dependent on class names (e.g. removing of the leading tab in normal and q paragraphs) - should this also be customizable?

failure on bundle exec rake with newest pull

AaronW-MBP:repositext-kramdown aaron$ bundle exec rake warning: ignoring extraneous ruby-' prefix in versionruby-2.0.0-p353'
(set by /Users/aaron/Documents/repositext/repositext-kramdown/.ruby-version)
/Users/aaron/.rbenv/versions/2.0.0-p353/bin/ruby -I"lib:lib:spec" -I"/Users/aaron/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib" "/Users/aaron/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib/rake/rake_test_loader.rb" "spec/*_/__spec.rb"
Run options: --seed 2673

Running:

.......................................................................................F........

Finished in 0.090116s, 1065.2936 runs/s, 1065.2936 assertions/s.

  1. Failure:
    Kramdown::Element::inspect_tree#test_0001_prints a representation of element's tree [/Users/aaron/Documents/repositext/repositext-kramdown/spec/kramdown/patch_element_spec.rb:8]:
    --- expected
    +++ actual
    @@ -1,12 +1,12 @@
    " - :root - {:encoding=>#Encoding:UTF-8, :location=>1, :abbrev_defs=>{}}
    - :p - {:location=>1}
  • - :text - \"para \"
    
  • - :text - {:location=>1} - \"para \"
    
    • :em - {:location=>1}
  •   - :text - \"one\"
    
    • :blank - "\
  •   - :text - {:location=>1} - \"one\"
    
    • :blank - {:location=>3} - "
      "
  • :p - {:location=>3}
  • - :text - \"para \"
    
  • - :text - {:location=>3} - \"para \"
    
    • :em - {:location=>3}
  •   - :text - \"two\"
    
  •   - :text - {:location=>3} - \"two\"
    
    "

96 runs, 96 assertions, 1 failures, 0 errors, 0 skips
rake aborted!
Command failed with status (1): [ruby -I"lib:lib:spec" -I"/Users/aaron/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib" "/Users/aaron/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rake-10.1.1/lib/rake/rake_test_loader.rb" "spec/*_/__spec.rb" ]

Tasks: TOP => default => test
(See full trace by running task with --trace)

Idml converter losing text withinin HyperlinkTextSource elements

<CharacterStyleRange AppliedCharacterStyle="CharacterStyle/Regular">
  <Content> </Content>
  <HyperlinkTextSource Self="u3e7e" Name="Source" Hidden="false" AppliedCharacterStyle="n">
    <Content>had no</Content>
  </HyperlinkTextSource>
  <Content> prayer card, but she touched the border of His garment, for she said in her heart, “I know that Man tells the Truth. If I can touch His garment, I’ll be made well.” </Content>
</CharacterStyleRange>

How to get syntax highlighting

cd ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/
git clone https://github.com/maliayas/MarkdownEditing
cd MarkdownEditing
git checkout nathanael

Restart sublime.

In order to customize any of the colors;

  1. Inspect the scope name of the area via ctrl+shift+p. The scope name will appear in the status bar.
  2. Find the scope name in the MarkdownEditor.tmTheme file and edit the color as you wish. You can set one or two of the foreground and background colors.

What is the best way to perform transforms on the internal representation?

For example, certain exports will require that I highlight the word following a sync marker with an additional span tag.

Another export will require that I apply classes to paragraph numbers and their parent block based on the number of digits in the paragraph number.

What's the best way for me to apply this kind of logic to the tree?

Treat Unicode 2029 like <Br/> tag

As per this conversation:

I think we should probably treat 0x2029 just like <Br />, as it originally had that role - even if it's no longer the 'modern' paragraph separator.

Note to Jo: Implement in Kramdown::Parser::IDMLStory#parse_char_children

kramdown_to_icml fails

I tried to convert some of the at files to icml to proof over them and I get the following. It fails on the first file and stops. It does create an icml but that file will not open.

AaronW-MBP:vgr-english aaron$ bundle exec kramdown_to_icml './content/65/*.at'

Batch converting all kramdown files at ./content/65/*.at.

  • importing ./content/65/ENG65-0117.at
    writing to ./content/65/ENG65-0117.icml
    IDML story converter can't output elements of type convert_gap_mark
    /Users/aaron/Documents/repositext/repositext-kramdown/lib/kramdown/converter/idml_story.rb:169:in method_missing' /Users/aaron/Documents/repositext/repositext-kramdown/lib/kramdown/converter/idml_story.rb:32:inconvert'
    /Users/aaron/Documents/repositext/repositext-kramdown/lib/kramdown/converter/idml_story.rb:39:in block in inner' /Users/aaron/Documents/repositext/repositext-kramdown/lib/kramdown/converter/idml_story.rb:39:ineach'
    /Users/aaron/Documents/repositext/repositext-kramdown/lib/kramdown/converter/idml_story.rb:39:in inner' /Users/aaron/Documents/repositext/repositext-kramdown/lib/kramdown/converter/idml_story.rb:228:inparagraph_style_range_tag'
    /Users/aaron/Documents/repositext/repositext-kramdown/lib/kramdown/converter/idml_story.rb:115:in convert_p' /Users/aaron/Documents/repositext/repositext-kramdown/lib/kramdown/converter/idml_story.rb:32:inconvert'
    /Users/aaron/Documents/repositext/repositext-kramdown/lib/kramdown/converter/idml_story.rb:39:in block in inner' /Users/aaron/Documents/repositext/repositext-kramdown/lib/kramdown/converter/idml_story.rb:39:ineach'
    /Users/aaron/Documents/repositext/repositext-kramdown/lib/kramdown/converter/idml_story.rb:39:in inner' /Users/aaron/Documents/repositext/repositext-kramdown/lib/kramdown/converter/idml_story.rb:55:inconvert_root'
    /Users/aaron/Documents/repositext/repositext-kramdown/lib/kramdown/converter/idml_story.rb:32:in convert' /Users/aaron/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/kramdown-1.3.0/lib/kramdown/converter/base.rb:104:inconvert'
    /Users/aaron/Documents/repositext/repositext-kramdown/lib/kramdown/converter/icml.rb:39:in compute_story_xml' /Users/aaron/Documents/repositext/repositext-kramdown/lib/kramdown/converter/icml.rb:28:inconvert'
    /Users/aaron/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/kramdown-1.3.0/lib/kramdown/converter/base.rb:104:in convert' /Users/aaron/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/kramdown-1.3.0/lib/kramdown/document.rb:120:inmethod_missing'
    /Users/aaron/Documents/repositext/repositext-kramdown/lib/repositext/cli/converter_icml.rb:41:in block in run' /Users/aaron/Documents/repositext/repositext-kramdown/lib/repositext/cli/converter_icml.rb:29:ineach'
    /Users/aaron/Documents/repositext/repositext-kramdown/lib/repositext/cli/converter_icml.rb:29:in run' /Users/aaron/Documents/repositext/repositext-kramdown/bin/kramdown_to_icml:16:in<top (required)>'
    /Users/aaron/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/bin/kramdown_to_icml:23:in load' /Users/aaron/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/bin/kramdown_to_icml:23:in'
    AaronW-MBP:vgr-english aaron$

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.