hackmdio / hackmdio/hackmd-io-issues

[Feature Request] Allow access to frontmatter variables within the body of a note

Aperta
#238 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
feature
Lingua principale
Nessun dato sulla lingua
Stelle
40
Fork
9
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

**Is your feature request related to a problem? Please describe.**
Whenever including tags or other metadata in a note, one must include them in two places:

1. the front matter
2. again in the body of the note

This completely goes against the DRY principle. If you're putting the same data in two places, something needs to be optimized.

**Describe the solution you'd like**
There should be some way to include variables from the frontmatter in the body of a note, e.g.:

```md
---
title: a simple note
tags: hackmd, github
---

{% title %}
===

###### tags: {% tags %}

hello world
```

Further, it would be awesome if this feature supported *custom* variables. I like to include the `created` variable in my notes for personal reference and compatibility with other platforms. Even though such a tag provides no extra functionality on hackmd, it would be splendid to be able to include the date a note was written in the body of the note without repeating myself.

This would further allow you to create better templates and better embeds. e.g.:

*header.md*
```md

###### tags: {% tags %}

{% created %}

{% title %}
===
```

*footer.md*
```md
{% authors %}
```

*meeting-notes-template.md*
```md
---
title: meeting notes
created: 2021-02-22
tags: meeting, notes
authors: jack, dianne
---

{%hackmd @team/header %}

{%hackmd @team/footer %}
```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Esamina gli esempi in header.md, footer.md e meeting-notes-template.md per comprendere il frontmatter richiesto e l'uso delle note incorporate. Definisci cosa significa “done” per le variabili integrate e personalizzate nei corpi delle note e negli embed, inclusi i casi mostrati di title, tags, created e authors.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
markdown
Ambito
content
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.