GithubHelp home page GithubHelp logo

should be able to escape ^L about pando.py HOT 8 CLOSED

aspenweb avatar aspenweb commented on September 27, 2024
should be able to escape ^L

from pando.py.

Comments (8)

chadwhitacre avatar chadwhitacre commented on September 27, 2024

Now that we support caret-L in addition to true page breaks, you have a workaround for a common case, displaying a simplate snippet on a web page, using the HTML-specific escape: ^L.

from pando.py.

pjz avatar pjz commented on September 27, 2024

The simplate should realy be breaking on \n^L\n, right? That is, a ^L on a line by itself? So if you have a print("^L") it should be fine, right?

from pando.py.

chadwhitacre avatar chadwhitacre commented on September 27, 2024

I don't think we want to break on \n^L\n. Sometimes I like to emphasize breaks by doing:

# ============================= ^L

Other times I like to keep text files trim by doing:

^Lfoo

I think ^^L should be the escape sequence (caret-caret-ell).

from pando.py.

pjz avatar pjz commented on September 27, 2024

Oh, wow, I totally didn't realize that a ^L anywhere would do that. Why do you think we should avoid breaking on \n^L\n ? I think I like the idea of \n^L\n more since it would be 1) more obvious where it was in the file and 2) it would mean you have to worry less about escaping a ^L that's used in code or data since it's not the single char that is the break, it's 3 chars in a row, so it's more unlikely to occur.

If you want to emphasize a break you could do

# =========================================
^L
<!-- ======================================= -!>

Or even just either one of the horizontal lines.

from pando.py.

lyndsysimon avatar lyndsysimon commented on September 27, 2024

I propose that a line containing an unescaped ^L be discarded entirely. This would break @whit537's case above where he is using ^Lfoo, but all other comment styles would remain supported.

If this is implemented, then the user can choose any type of separation they feel appropriate:

^L

=========== ^L

----------------------^L----------------------

et cetera.

from pando.py.

pjz avatar pjz commented on September 27, 2024

Don't forget that the ^L line can now have syntax between the ^L and the following EOL -

class Counter:
   value = 0
counter = Counter()
^L
counter.value += 1
number = counter.value
^L #!pystache text/plain
Hello, visitor # {{ number }} !
^L #!pystache text/html
<H1>Hello, visitor # {{ number }} ! </H1>
^L #!pystache text/json
{ message: "Hello!", visitor_number: {{ number }} }

from pando.py.

pjz avatar pjz commented on September 27, 2024

Closable since #167 includes escapable pagebreaks.

from pando.py.

chadwhitacre avatar chadwhitacre commented on September 27, 2024

!m

from pando.py.

Related Issues (20)

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.