quarto-div-reuse

The power of "code/content reuse" for seamless and efficient content creation.

https://github.com/mcanouil/quarto-div-reuse

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (6.6%) to scientific vocabulary

Keywords

code-reuse div-reuse filter lua quarto quarto-extension quarto-filter
Last synced: 4 months ago · JSON representation ·

Repository

The power of "code/content reuse" for seamless and efficient content creation.

Basic Info
Statistics
  • Stars: 6
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 3
Topics
code-reuse div-reuse filter lua quarto quarto-extension quarto-filter
Created 11 months ago · Last pushed 4 months ago
Metadata Files
Readme Funding License Citation

README.md

Div-reuse Extension For Quarto

This is a Quarto extension applying the concept of "code reuse" to the content of a Markdown fenced div.

Installing

bash quarto add mcanouil/quarto-div-reuse

This will install the extension under the _extensions subdirectory. If you're using version control, you will want to check in this directory.

Using

To activate the filter, add the following to your YAML front matter:

  • Old (<1.8.21):

yml filters: - quarto - div-reuse

  • New (>=1.8.21):

yml filters: - path: div-reuse at: post-quarto

Then, you can reuse any fenced div by using their ID in the following way:

```markdown

Original Div

::: {#my-div} {{< lipsum >}} :::

Reused Div

::: {reuse="my-div"} ::: ```

[!IMPORTANT] The "reuse" attribute acts like a copy-paste of the original div content. Consequently, content and their attributes, including the ID, are duplicated. This can result in unexpected behaviour if the same ID is used multiple times within the same document.

Therefore, it is recommended to use the "reuse" attribute primarily with text content.

Example

Here is the source code for a minimal example: example.qmd.

Outputs of example.qmd:

Owner

  • Name: Mickaël Canouil
  • Login: mcanouil
  • Kind: user
  • Location: Lille, France

Biostatistician, Ph. D. (& cinephile) @RLille User Group Organiser

Citation (CITATION.cff)

cff-version: 1.2.0
title: "Div Reuse Extension for Quarto"
message: "If you use this project, please cite it as below."
type: software
authors:
  - family-names: "Canouil"
    given-names: "Mickaël"
    orcid: "https://orcid.org/0000-0002-3396-4549"
repository-code: "https://github.com/mcanouil/quarto-div-reuse"
url: "http://m.canouil.dev/quarto-div-reuse/"
license: "MIT"
date-released: "2025-04-05"
version: 1.0.1

GitHub Events

Total
  • Release event: 2
  • Watch event: 6
  • Delete event: 4
  • Push event: 10
  • Public event: 1
  • Pull request event: 6
  • Create event: 6
Last Year
  • Release event: 2
  • Watch event: 6
  • Delete event: 4
  • Push event: 10
  • Public event: 1
  • Pull request event: 6
  • Create event: 6

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 1
  • Total pull requests: 5
  • Average time to close issues: less than a minute
  • Average time to close pull requests: less than a minute
  • Total issue authors: 1
  • Total pull request authors: 2
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 5
  • Bot issues: 0
  • Bot pull requests: 2
Past Year
  • Issues: 1
  • Pull requests: 5
  • Average time to close issues: less than a minute
  • Average time to close pull requests: less than a minute
  • Issue authors: 1
  • Pull request authors: 2
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 5
  • Bot issues: 0
  • Bot pull requests: 2
Top Authors
Issue Authors
  • mcanouil (1)
Pull Request Authors
  • mcanouil (3)
  • github-actions[bot] (2)
Top Labels
Issue Labels
Pull Request Labels
Type: CI/CD :robot: (4) Type: Documentation :memo: (1)

Dependencies

.github/workflows/release.yml actions