Skip to content

Better differentiate between kinds of code samples #961

@cuihtlauac

Description

@cuihtlauac

It's been raised by @christinerose when reviewing documentation that it isn't easy to make the difference between the various kinds of code samples found in markdown documents.

Today, we are mainly using using two:

```ocaml
```ocamltop

However, there are more cases

  • Hash and double semicolumn stuff
    • standalone top-level expression
    • top-level expression with environment references
  • w/o hash and double semicolumn
    • valid code sample, which may be copied into the top-level
    • valid code sample with many references, which shouldn't be copied into the top level
    • pseudo code, which must not be copied in the top-level

We need to devise a better way to handle this.

Edit:

Additional input in the same lines from @Tchou, #950 (comment):

  • w.r.t to code examples, it's ok to give code that, in isolation, does not compile (e.g. because some value is not defined because it was defined three examples above) but syntactically incorrect code such as val Option.map : … will be confusing for beginners that will try to cut and paste it. Maybe in such case, not use a code formatting box but just some tt font ?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    📋 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions