Closed beechnut closed 3 months ago
I think a possible solution here would be an addition to the Markdown filter that parses code blocks somewhat differently than standard.
\```diff-yaml
---
# Adds the filename to the top of the file, but it's not copyable in the same textarea as the code block
filename: docker-compose.yml
line_numbers: true # defaults to true
# Which lines to collapse, useful when showing diffs but wanting to still preserve line numbers
collapse:
- 7 to 11
- 14 to 16
- 22 to end
---
version: "3"
services:
+ oracledb: &oracledb
image: container-registry.oracle.com/database/express:21.3.0-xe
volumes:
- ${FOLDER_WITH_IMPORT_FILE}:/db/data
- oracle_data_volume:/opt/oracle/
ports:
- 1521:1521
+ expose:
+ - 1521
environment:
- ORACLE_PWD=${ORACLE_PASSWORD}
+ import:
+ <<: *oracledb
+ profiles: ["utilities"]
+ command: impdp ${ORACLE_USER}/${ORACLE_PASSWORD}@oracledb:1521/XEPDB1 directory=db_data dumpfile=${FILE_TO_IMPORT}
volumes:
oracle_data_volume:
Would produce something like
|------------------------------------
| docker-compose.yml | <- copyable, but separate from source code
|------------------------------------
| 1 | version: "3" [Copy icon]
| 2 |
| 3 | services:
| 4 |
| 5 | + oracledb: &oracledb
| 6 | image: container-registry.oracle.com/database/express:21.3.0-xe
| ↕ |
| 12 | + expose:
| 13 | + - 1521
| ↕ |
| 17 | + import:
| 18 | + <<: *oracledb
| 19 | + profiles: ["utilities"]
| 20 | + command: impdp ${ORACLE_USER}/${ORACLE_PASSWORD}@oracledb:1521/XEPDB1 directory=db_data dumpfile=${FILE_TO_IMPORT}
| 21 |
| ↕ |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ copyable source code
^^^^^ non-copyable line numbers
The technical tutorial I'm drafting for the blog looks kind of rough.
Problems
like this
have a font size that looks bigger, but otherwise isn't visually offset enough to be distinct.Nice-to-haves