inkle / inkle/ink

[Proposal] Embedding other markup without adding more grammar

Open
#681 6 comments 2 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
4.9k
Forks
540
PR merge metrics
No merged PRs in 30d

Description

_Before I raise any PR, I wanted to check if this is feasible._

I'm writing a story and I'd like to include Markdown as the markup language. There's a bit of overlap between markdown & Ink and a few characters should be escaped. Example:

```
-> Menu

=== Menu ===

\**Select one**
_Select one_
`Code`

listitem:
1. item1

\- item1
\- item2

\--- // new line
```

There are a few more edge cases (escaping URLs, for examples). Searching in the issues for this repo reveals:

- Issues with the `*`. https://github.com/inkle/ink/issues/275
- URLs. https://github.com/inkle/ink/issues/153#issuecomment-617548445
- Hash symbols https://github.com/inkle/ink/issues/560
- Square brackets https://github.com/inkle/ink/pull/385

Most of the issue can be solved with escaping — e.g. `\*`. But if the text contains several of those, it's really hard to write a story and escape all the characters as well.

I looked in the documentation for an instruction to escape a block of text. Example:

```
-> Menu

=== Menu ===

{raw
**Select one**
_Select one_
`Code`

listitem:
1. item1

- item1
- item2

--- // new line
}
```

But I realised that Ink doesn't offer such functionality.

I tried to look for other workarounds and realised that I could escape the text with a function:

```
EXTERNAL md_bold(string)

-> Menu

=== Menu ===

{md_bold("Hello")} World!

-> END
```

The issue is that I can't have arguments that span multiple lines:

```
EXTERNAL MARKDOWN(string)

-> Menu

=== Menu ===

{MARKDOWN("Hello
new line")} World!

-> END
```

So I was wondering if it is possible (and acceptable) to contribute a feature to:
- Either extend the language with a new word to escape blocks of text.
- Extend function arguments to span multiple lines.

Thanks,
Dan

P.S.: Both features enable a (convenient? annoying?) side effect. I can embed any other markup language in Ink and I can write my own extensions without changing the compiler.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.