Permalink
Switch branches/tags
Nothing to show
Commits on Jul 15, 2012
  1. Fixing lists.

    This cleans up the fix-lists branch quite a bit. to_s is working again.
    committed Jul 15, 2012
Commits on Jul 4, 2012
  1. Merge branch 'master' into fix-lists

    Conflicts:
      lib/marker/lists.rb - renamed phrase to content and list_item to item
    committed Jul 4, 2012
  2. Fixing more rules that relied on inner rule names.

    Adding aliases to fix arg-safe variants.
    committed Jul 4, 2012
  3. Fixing lists contained in templates.

    Lists were rendering by referring directly to "list_item" and "phrase" rule
    names. These needed to be updated to "item" and "content" aliases supported by
    both arg-safe and normal variants, because the arg-safe rules refer to other
    arg-safe rules.
    committed Jul 4, 2012
  4. Fixing options handling in Argument#to_html.

    Argument#to_html should forward render options to to_s.
    committed Jul 4, 2012
  5. Adding a few fixes to the last language update.

    * Caught an unsafe rule in an arg-safe rule
    * Adding support for blank or all whitespace documents
    committed Jul 4, 2012
  6. Fixing a couple minor bugs in Document.

    * Fixed rendering footnotes, which was destructive because it used Array#shift
    * Added "---- Notes ----" to footnote rendering as text
    * Fixed handling of documents without markup.
    committed Jul 4, 2012
  7. Added argument-safe variants of the markup rules.

    The previous attempt to update the language to allow full markup inside
    templates (not just a single text paragraph) didn't quite work because it
    removed the template_end and arg_delimiter rules from all text. This worked for
    templates -- they were correctly matched and could include markup -- but broke
    generic markup because out of laziness it included those rules at the top
    level. This caused those delimiters to prevent the other markup rules from
    correctly matching. For example:
    
      == Heading }} ==
      Arguments are separated by a "|" character.
    
    The above markup was not matching the heading because headings could not
    contain the "}}" delimiter, even outside of templates. Also, the paragraph was
    broken into 3 because "|" would be made into its own block. These problems
    needed to be resovled by mirroring all of the rules that contain (directly and
    transitively) the template end delimiters with template-safe variants. These
    all begin with arg_safe_ and are located near the normal rules so they are
    edited at the same time.
    
    The new rules use the same classes and modules as the non-safe variants, so
    rendering is completely unchanged.
    committed Jul 4, 2012
Commits on Dec 29, 2011
  1. Updating some rule names to be more clear.

    "safe" is now used to show that rule combinations are okay.
    "known" is now used to remind about requiremens for rule use.
    
    text rules:
    * unsafe_text -> known_text (since it is known to begin with text)
    * unsafe_paragraph -> known_paragraph
    
    template rules:
    * arg_verbatim -> arg_safe_verbatim
    * arg_verbatim_area -> arg_safe_verbatim_area
    * arg_block -> arg_safe_block
    * arg_markup -> arg_safe_markup
    * unsafe_arg_markup -> arg_safe_known_markup
    committed Dec 29, 2011
  2. Fixing a minor bug with plain text arguments.

    Also adding a lot of passing tests.
    committed Dec 29, 2011
  3. Adding all updated, passing tests.

    Added a helper method to the helper, but I think it needs to be improved to
    work as a proper assertion before porting all the tests to it.
    committed Dec 29, 2011
  4. Updating the langauge grammar to fix template bugs.

    Major changes:
    1. blocks and arg_blocks no longer match blanks, instead blocks are separated
       by at least one newline in the grammar. Because no blank lines are matched
       as blocks, now markup sections (like paragraphs) in HTML are only separated
       by a single newline. This also removes all inline functions!
    
    2. markup inside template arguments must begin with a newline. Now unsafe_text
       is used to match the first line, if it is present.
    
    3. A new top-level rule, document, was introduced to do document setup and
       append any footnotes. This is so markup blocks inside templates do not add
       footnotes when they are present and so that newlines are handled correctly.
    
    Updating markup.rb for grammar changes:
    * Introduced the Document class
    * Separated to_html and to_s in Markup between Markup and Document
    * Changed to_s to insert two newlines to separate Markup paragraphs, because
      all newlines between blocks are compacted.
    committed Dec 29, 2011
  5. Fixing the gemspec dependency on treetop.

    Should be ~> 1.4 instead of >= 1.4.2
    committed Dec 29, 2011
Commits on Jan 17, 2011
  1. Adding no_wrap? check to paragraphs.

    no_wrap? determines whether a paragraph should render a block of text wrapped
    in <p> for html.  This inspects the parse tree to see if the block of text is
    really just a single template.  If it is a lone template, then it should not be
    wrapped since it is most likely a block template.  This is not always the case,
    but it should be often enough that it is a good assumption to make.
    
    This ensures that this is not incorrectly wrapped in a paragraph:
    
    {{ floating text box |* list of stuff }}
    
    However, this inline template will be rendered incorrectly, which is part of
    the compromise:
    
    {{tt|inline fixed-width text}}
    
    This is a rare situation.
    committed Jan 17, 2011
  2. Fixing bug: unsafe_text wrapped in a paragraph.

    Unsafe text wrapped in a paragraph could not be accessed because there was no
    'text' attribute.  This fix renames unsafe_text to text, which matches safe
    text.
    committed Jan 17, 2011
  3. Adding a compromise for template embedding.

    Templates can be embedded as inline or block style--just like html.  Inline
    style is for options like fixed-width text that can be embedded in a paragraph
    without needing a change in the html structure.  Block style is for things that
    should not be embedded in paragraphs.  This is now necessary because it is
    possible to have markup, not just text, inside a template.
    
    Unfortunately, it is difficult to split paragraphs when a template renders as a
    block.  It is also difficult to detect when a template renders as a block,
    since anything can be returned by templates when they are rendered.  The
    compromise is to assume that templates that contain block values will render as
    blocks (since they must) and that templates with only inline values will render
    inline.  Templates that contain block arguments are wrapped in divs to avoid
    encapsulation problems (paragraphs cannot directly contain paragraphs) and
    inline templates are not wrapped.
    
    Text changes:
    * Added TextBlock for text blocks that are not paragraphs (in templates)
    
    Language changes:
    * Added a paragraph rule that wraps text blocks where they should be
    * Changed text rules to use TextBlock
    * Similar changes for unsafe_ rules
    * Added inline text rules back to templates
    * Separated inline and block arguments using classes
    
    Template changes:
    * Added Argument subclasses InlineArgument and BlockArgument
    * Added block? methods to arguments
    * Added block? method to arg lists, true if any arg is a block
    * Added block? method to templates, true if the arg list is
    * Added block handling to html rendering, which adds a div to block templates
    committed Jan 17, 2011
  4. Adding .gitignore.

    committed Jan 17, 2011
Commits on Dec 8, 2010
  1. Allowing newlines before keyword args in templates.

    This changes the rule for keyword arguments, substituting aws for ws in the
    beginning.  This is to allow keyword arguments to be used on new lines.
    Keyword arguments just need to have the keyword and the "=" on one line.
    
    This is now allowed:
    {{ template name |
    keyword = some markup
    }}
    committed Dec 8, 2010
Commits on Nov 19, 2010
  1. Updated template to produce no named args for :raw.

    One problem with templates is that if "|" is used in the content, it gets
    removed and interpreted as an argument delimiter.  Raw formatted template
    arguments are supposed to be a way to increase the flexibility of templates by
    making the "raw" parsed text available to templates that wanted to do something
    different with it.  For example, syntax highlighting needs to get
    the raw content to correctly display code:
     {{ ruby |
     names.each do |name='(unknown)'|
       puts "hello, #{name}!"
     end
     }}
    
    Before this commit, only the value of named parameters was given in raw form,
    which meant that in cases like the above, the text could not be reconstructed.
    This commit changes the raw format so that all parameters, named and
    positional, are given in order as their original text values.
    committed Nov 19, 2010
  2. Updated to allow line-anchored markup in templates.

    Previously, newlines were allowed inside templates, but line-anchored markup
    (lists, verbatim, etc.) was not possible.  These changes make it possible to
    have line anchored markup render correctly when inside templates.
    
    The changes move delimiters for templates ("|" and "}}")  up to the block
    level, along with list, text, and others.  This way, the delimiters will still
    match as text when they are not part of a template.  However, they are easily
    removed for the new arg_markup, arg_block, etc. rules that match more markup
    inside templates, without missing the template's delimiters.
    
    These changes should help when writing templates that don't use formatted
    parameters, like syntax highlighting templates.  Those templates will now have
    access to the original whitespace that was previously stripped by the rule,
    since whitespace rules around template arguments were removed--the markup rules
    handle whitespace themselves.
    
    The line rule is now gone.  It was merged into the block rule (and now
    arg_block), which makes more sense since line contained a couple of multi-line
    rules.  It was intended to mean line-anchored, but wasn't really necesary and
    it made sense to remove it.
    
    Next problems to solve:
    1. | and }}, when caught at the block level, will be rendered as paragraphs
    2. In general, html paragraphs will need to be reworked
    3. Templates that contain "|" as content will be difficult to write
    committed Nov 19, 2010
  3. Updating the templates tests to include options.

    In previous commits, the options were not part of the default render because
    they included a :tree option that was the parse tree for the template.  This
    was just a hack, so it is now removed and options should be verified in the
    tests as well.
    committed Nov 19, 2010
Commits on Nov 14, 2010
  1. Templates: Added :raw format and format changing.

    Now the render options can specify the format for a template's arguments.  This
    allows special templates like syntax highlighting to avoid rendering arguments
    entirely (by setting options[:template_formats][:template_name] = :raw) so that
    the arguments can be rendered by the template itself without side-effects like
    link footnotes.  The :raw format simply returns the original parsed text of
    arguments.
    
    Another change in this commit is to remove the :tree option that was added a
    few commits ago.  It was a bad idea, although necessary in some cases.  I
    think, however, for those cases it is better to monkey-patch something in.
    committed Nov 14, 2010
Commits on Nov 13, 2010
  1. Fixed the w3c validation bug!

    Unfortuantely, this breaks text output.  I'll have to fix that sometime soon,
    but it will be a good opportunity to implement text wrapping anyway.
    
    This was annoyingly difficult.  There are two main changes: First, a new
    subclass of ListBuilder, ItemBuilder is now used to wrap the inner content of
    lists--the contained phrases in most cases.  This list builder determines when
    other ListBuilders can be appended to the content, since sub-lists should be
    nested under items.
    
    Second, all of the HTML output now goes through ListBuilder and to_html is no
    longer called on the parsed SyntaxNodes.  This is because ListBuilder needed to
    add item tags (e.g., <li>) to each level in addition to the list type tags
    (<ul>).  Instead of adding parameters to ListBuilder to make this work,
    ListBuilder is now subclassed for each list type and those subclasses take care
    of knowing how to render the correct HTML tags.  This will probably work out
    well when I go back to reimplement the text formatting.
    committed Nov 13, 2010
  2. Adding code for a potential fix to the tab bug.

    It's currently commented out, so this doesn't change anything.
    committed Nov 13, 2010
Commits on Aug 28, 2010
  1. Updating calls to template functions to include options.

    Options should be passed to template calls so they can be used, not including
    it at first was an oversight.
    
    Options passed to template functions also includes :tree now, which is the
    parse tree for the template.  This allows template functions to access the raw
    source for the markup, which is needed right now to support syntax
    highlighting.
    committed Aug 28, 2010
Commits on Jul 11, 2010
  1. Adding escaped characters and tests, small optimization.

    Escaped characters only apply inside templates.  I think this breaks \| outside
    of templates though.  Ugh.
    committed Jul 11, 2010
Commits on Jul 10, 2010
Commits on Jun 13, 2010
  1. Removing README in rdoc format.

    Hopefully github will pick up the README.html file.
    committed Jun 13, 2010
  2. Adding .marker and .html documentation.

    Also adding a Rake task to compile README.marker to README.html.
    committed Jun 13, 2010