RISC OS Open
Safeguarding the past, present and future of RISC OS for everyone
ROOL
Home | News | Downloads | Bugs | Bounties | Forum | Documents | Photos | Contact us
Account
Forums → Tests →

Pre versus Pre Code

Subscribe to Pre versus Pre Code 6 posts, 4 voices

 
Jul 29, 2021 4:42pm
Avatar Rick Murray (539) 11793 posts

I wonder if there’s a difference?

This is just pre tags:

This
Is
Some
Text.

And here is the pie core version (“pre code” but swipe-type wasn’t having that):

This
Is
Some
More
Text.
 
Jul 29, 2021 4:45pm
Avatar Rick Murray (539) 11793 posts

Looks the same. Let’s try a longer example.

Pee (thank you swipe-type):

1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890

And now pure coffee (wtf swipe-type, are you trolling me?):

1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890
 
Jul 29, 2021 4:46pm
Avatar Rick Murray (539) 11793 posts

Still look alike…?

 
Jul 29, 2021 7:46pm
Avatar David J. Ruck (33) 1124 posts

Pre:-

class Pool:
"""Fake Pool class"""
def init(self,
processes = None,
initializer = None,
initargs = None,
maxtasksperchild = None):
self.processes = processes
self.initializer = initializer
self.initargs = initargs
self.maxtasksperchild = maxtasksperchild
initializer(*initargs)

@staticmethod def map(threadproc, threadargs): return map(threadproc, threadargs) @staticmethod def close(): pass @staticmethod def join(): pass


Pre Code:-
class Pool:
    """Fake Pool class"""
    def __init__(self,
                 processes        = None,
                 initializer      = None,
                 initargs         = None,
                 maxtasksperchild = None):
        self.processes        = processes
        self.initializer      = initializer
        self.initargs         = initargs
        self.maxtasksperchild = maxtasksperchild
        initializer(*initargs)

@staticmethod def map(threadproc, threadargs): return map(threadproc, threadargs) @staticmethod def close(): pass @staticmethod def join(): pass


Pre on it’s own double spaces the first block, both pre and pre+code fail to display the indent and blanks lines on the methods, so pretty naff for Python.

BTW The code is part of a fake multitasking module for RISC OS python, to allow multitasking code to run in a single task.

 
Jul 30, 2021 7:36am
Avatar Chris Mahoney (1684) 1920 posts

Textile aside, I don’t think <code> is supposed to do anything visually when inside <pre>; it’s used for semantics. For example, on our “knowledge base” at work, it causes the code to get syntax highlighting via some JavaScript that hooks into it.

 
Jun 25, 2022 1:03pm
Avatar David Boddie (1934) 216 posts
Is this shown as code?
With multiple lines?

Yes it is.

Reply

To post replies, please first log in.

Forums → Tests →

Search forums

Social

Follow us on and

ROOL Store

Buy RISC OS Open merchandise here, including SD cards for Raspberry Pi and more.

Donate! Why?

Help ROOL make things happen – please consider donating!

RISC OS IPR

RISC OS is an Open Source operating system owned by RISC OS Developments Ltd and licensed primarily under the Apache 2.0 license.

Description

Test posts.

Voices

  • Rick Murray (539)
  • David J. Ruck (33)
  • Chris Mahoney (1684)
  • David Boddie (1934)

Options

  • Forums
  • Login
Site design © RISC OS Open Limited 2018 except where indicated
The RISC OS Open Beast theme is based on Beast's default layout

Valid XHTML 1.0  |  Valid CSS

Powered by Beast © 2006 Josh Goebel and Rick Olson
This site runs on Rails

Hosted by Arachsys