[Skip Navigation] [CSUSB] / [CNS] / [CSE] / [R J Botting] /[Samples of MATHS] / [maths] / addRawData
[Index] [Contents] [Source Text] [About] [Notation] [Copyright] [Search ]
Mon Jun 13 11:40:39 PDT 2011

Contents


    Adding Raw Data to mth2html

      Status -- Pre-inception

      I've made a couple of false starts... and then recalled that it pays to list choices and think about them before proceding. A useful framework is called
    1. PISCO::= See http://cse.csusb.edu/maths/notn_5_Form.html#PISCO framework

      Also see [ ../reference.html#CORT PISCO 1 Purpose ]

      Purpose

        Original

        I want to find a simple way to include blocks of code/data/txt, YAML, plain text, XML, HTML, tab-delimitted, or comma separated text file data in a MATHS document.

        Revision

        Really need a means to embed ony other code and indicate its parsing.... including raw data that is parsed as a sequence of lines made of characters.

      . . . . . . . . . ( end of section Purpose) <<Contents | End>>

      Input

        Existing systems

        Can include a single line "As_is".

        Already have "...." for a other language string...

        HTML and CSS Rendering

        Data has a light black box round it? shadowed?

        markup as a DIVisision with class "Data"

        mth2html

        Unix stream editor sed can mark up each line of text before converting to HTML.
         		/^A/,/^B/s/^/x/
        Notice this also marks the A and B lines.

        Semantics of content

        Should be able to indicate parsing by a local description. This can be a link to a URL or a net.

        Default parsing is #char.

      1. raw::= # line.
      2. line::= #non(endl) endl.

        Revise MATHS documentation

        Is it time to revisit techniqus for specifying parsers?

      . . . . . . . . . ( end of section Input) <<Contents | End>>

      Solutions

        o Do nothing

        a Indicate raw data with directive Raw

         .Raw parsing
         text
         .Close.Raw

        b Use directive Data

         .Data parsing
         text
         .Close.Data

        Suggested by Dr. Ernesto Gomez.

        c Indicate Data by using dotted quotes

         .` parsing
         text
         .'

        d Use Code

         .Code parsing
         text
         .Close.Code

      . . . . . . . . . ( end of section Solutions) <<Contents | End>>

    . . . . . . . . . ( end of section Solutions) <<Contents | End>>

    Choice


      Table
      Solutionso Don'ta Rawb Datac Dot Quoted Code
      Ease use01020
      Ease Learn11202
      Ease do31101
      consequences-----
      best 000000
      likely000000
      worst000000
      plan B000000
      risk000000

      (Close Table)

    . . . . . . . . . ( end of section Choice) <<Contents | End>>

    Operations

      Examples of foreign data

      .Raw
    1. This is a sample of
    2. raw data. .This is a sample of .raw data

    .Data #(name:#char HT number:#char endl) John Doe 714-123-5678 John Doe 3678 Joan Roe 714-123-5878 Joan Roe 3878

.Code sed '/\.\/, /\.\'//s/^/.\/'

.Code /^\.\`/{ s/^\.\\.\\(.*\)$/<div class=\"Data\"><pre>\1/ s/^\.\`\.\'\(.*\)$/<\/pre></div>\1/ s/^\.\\(['].*\)$/\1/ bdone
}

Syntax

  • endl::=`system dependent end of line indicator character string".
  • non::=(character~(_)), any character except this one, STANDARD MATHS.
  • line::lexeme=#non(endl) endl.

  • syntax::=following
    Net
    1. data_block::syntax=open_data_line #(line ~ close_data_line) close_data_line.
    2. open_data_line::lexeme= ".`" encoding endl.
    3. close_data_line::lexeme= ".'" comment endl.
    4. encoding::=line.
    5. comment::=line.

    (End of Net)

    Rendering in mth2html

  • output::=following
    Net
    1. data_block::output=open_data_line #(line ~ close_data_line) close_data_line.
    2. open_data_line::output=open_data_line.syntax.
    3. close_data_line::output=close_data_line.syntax.
    4. line::output=".RawLine" line.syntax.

    (End of Net)

    HTML rendering or RAW data

    Note: must convert ASCI to HTML.

  • html::=following
    Net
    1. data_block::output= ... .
    2. open_data_line::output="<div class=\"Raw\"><pre>".
    3. close_data_line::output="</pre></div>".
    4. line::output= line.output.

    (End of Net)

    Changes to documentation

    [ ../../maths//notn_5_Form.html#Formatted definitions ]
    Table
    FormatTagEnd-TagPurposeLikely Type
    list".List"".Close.List"Represents an ordered list or sequence #(...)
    ...
    data".Raw"".Close.Raw"Preformatted data#line where line:=#non(endl) endl.

    (Close Table)

    . . . . . . . . . ( end of section Operations) <<Contents | End>>

    . . . . . . . . . ( end of section Adding Raw Data to mth2html) <<Contents | End>>

    End