Giter Club home page Giter Club logo

Comments (5)

DCsunset avatar DCsunset commented on July 20, 2024

Hello, can you show your command to compile this file? It could help me to reproduce this problem.

from pandoc-include.

dmitryperets avatar dmitryperets commented on July 20, 2024

Hi,

Suppose you have the three files that I've shown in the description (10-chapter1.md, 20-chapter2.md and the actual source markdown file called include-test.md), you can reproduce the problem as follows:

% cat include-test.md 
---
title: Testing Implicit References
---

!include 10-chapter1.md

!include 20-chapter2.md

% pandoc --filter pandoc-include -o include-test.html include-test.md
 
% cat include-test.html 
<p>[This is Header]</p>
<p>[Link][This is Header]</p>
<p><a href="#this-is-header">Explicit Link</a></p>
<h1 id="this-is-header">This is Header</h1>

from pandoc-include.

DCsunset avatar DCsunset commented on July 20, 2024

Hi, I tried to swap the two files but the issue still exists. Is it the same on your PC?

from pandoc-include.

dmitryperets avatar dmitryperets commented on July 20, 2024

Hmm yes, you are right... something confused me before, I thought I saw it working when the referenced item was included before the reference. Maybe I tested on a different environment, not sure.

So now it looks like pandoc-include doesn't allow implicit references at all.

This is how it works without pandoc-include:

% cat include-test.md     
---
title: Testing Implicit References
---

# This is Header

[This is Header]

[Link][This is Header]

[Explicit Link](#this-is-header)

% pandoc --filter pandoc-include -o include-test.html include-test.md

% cat include-test.html                                              
<h1 id="this-is-header">This is Header</h1>
<p><a href="#this-is-header">This is Header</a></p>
<p><a href="#this-is-header">Link</a></p>
<p><a href="#this-is-header">Explicit Link</a></p>

from pandoc-include.

DCsunset avatar DCsunset commented on July 20, 2024

This feature is not supported in pandoc-include because pandoc-include processes every file independently before merging them into one file.

But pandoc renders the implicit reference only when it sees any corresponding title in the same file. So the feature is difficult to implement in this filter.

If you have any ideas to solve this problem, feel free to comment here.

from pandoc-include.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.