Giter VIP home page Giter VIP logo

kotoba's People

Contributors

tombruijn avatar

Watchers

 avatar  avatar

kotoba's Issues

Prawn style on text only accepts one value

Rather than [:bold, :italic] prawn only accepts either one of the values, not an array, while the docs would indicate otherwise.

http://prawn.majesticseacreature.com/docs/0.11.1/Prawn/Text.html

Two solutions:

  • All formatting should be done inline and only things like spacing, leading, etc. defined on a text command.
  • Do not pass style to text, but filter it out and tell users they can't define style on whole sections of text with the layout configurator, but that it is meant only for inline code spans?

Table of Contents generation

Automatic ToC generation?

Kotoba.config.layout.toc do |t|
  t.title = "Table of Contents"
  t.page = 2
  t.filler = "." # Title..............3
  t.levels = 2 # Two levels deep
  # etc.
end

Automatic line height?

Let Kotoba calculate a line height automatically based on a user's font size when the line height is not set?

  • Does it contribute anything?
  • Does it make anything easier?
  • Should there be a line height default at all? (if it is not implemented this should probably be set to nil || 0)

List indenting

Lists now do not indent from the prefix, but from the text.

Example

Expected output:

- I am a list
  on two lines.

Received output:

- I am a list
on two lines.

Solution

A possible solution would be to use the indent prawn method, but that would require the list to be wrapped in a bounding_box and the prefix to be placed in a different way.

Inline element styling (links, em, b, etc)

Add styling options for links, emphasis, bold, etc.

  • The Styling class has all the configuration needed (right now).
  • The inline formatting method in the prawn converter needs to support all of them.
  • The em and b methods should use inline formatting method.
  • Move into its own modules (out of prawn converter)

Planning

This list contains issues/features from the start, I'm slowly moving new issues into their own separate issues. So check out the issue tracker as well.
When everything is checked on this issue it will be closed.

Must have

Sections

  • Support for sections (be able to configure its support: on/off)
  • Customize section spacing (a line or a moved cursor distance) ecb632b
  • Start new chapters (different dir) on a new page
  • Custom blank/new pages through markdown 206f8fe

Paragraphs

  • Support for paragraph indent toggle (on/off)
  • Support for book indent toggle (on/off) (first paragraph of a section has no indent)

Headers and Footers

  • Support for footers and headers, be able to specify a block or text and kotoba will position it
  • Customize header and footer spacing from bounding box (footer) or top of page (header)

Page numbering

  • Customize page numbering (position and string page <page> of <total> (actual syntax)
  • Page numbering automatic position based on recurring element type (top/bottom page)
  • Page numbering should listen to all layouts, loop through them and call prawn's page numbering with the layout's page range.

Styling layouts

  • Support for layout_for [page..range] do |p| etc..
  • Add your own font, see pull request #4
  • customize indent on any style, better options since 0c8b637, but still not solved/tested entirely
  • PDF outline: a Table of contents, but as metadata, not as text in the PDF
  1. Moved to issue #6: automatic line height based on (a user's) font size (when not set by user).

Other

Should have

  • Custom metadata to add to PDF
  • PDF security, see Prawn

Could have

  • Moved to issue #7: Table of Contents generation at a page of your choosing? config.layout.toc.page = 2

Styling:

  • headings
  • paragraphs
  • ordered lists
  • unordered lists
  • code blocks
  • inline code
  • quote blocks
  • horizontal rules
  • horizontal rule styling
  • ref definitions
  • links
  • images
  • emphasis
  • strong
  • divs
  • inline formatting support, for non-markdown supported styling as seen here: http://prawn.majesticseacreature.com/docs/0.11.1/Prawn/Text.html (see #2)
    • strikethrough
    • underline
    • color
    • font size
  • Smartypants quotes
  • Support for entities & * " '
  • A to_filtered_text method that clears any inline formatting for use in Toc

Bugs

  • A header that is bold with a element inside that is italic. The italic element will only be italic, not bold italic
  • Catch not found config.rb file in CLI
  • when text is too big to fit on one page (certain styling) and it overflow onto the next, the new text gets the new styling, but the overflowing text doesn't and the margins also don't the new styling.
  • Page numbering active when set to false. It does not listen to the layout_for correctly, will always listen to the last page.

Research

  • Prawn default styling settings, see: Kotoba.config.layout.default

Server

  • Move to its own gem (taken out any reference to it in the code)

Automatic heading numbering

Allow automatic numbering of headings just like how li-s are numbered.

Kotoba.config.layout.heading 1 do |h|
  h.prefix = "{n} "
end

Examples

As a prefix

1 Heading

Just a number (how to support that through a prefix?)

1

Maybe even add line break support so headings can turn out like:

                5
Somewhere in the middle of the story

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.