Giter VIP home page Giter VIP logo

Comments (6)

ronaldtse avatar ronaldtse commented on September 5, 2024 1

@neontapir @pddzaic thank you for the report and the reproducible case!

@paolobrasolin would you have time to look at this? Thanks!

from asciidoctor-bibliography.

pddzaic avatar pddzaic commented on September 5, 2024 1

Hi paolobrasolin

Back from vacation, I have tested the implementation.

On the first look: it works.

On the second look: Other thinks are broken now.

Let's assume the following file structure with two folders:

tbl
     tbl-001.adoc
src
     test.bib
     test.adoc

File test.bib:

@ARTICLE{test,
  author = {L[eslie] A. Aamport},
  title = {The Gnats and Gnus Document Preparation System},
  journal = {\mbox{G-Animal's} Journal},
  year = 1986,
}

File tbl-001.adoc:

[align="center"]
[%header%autowidth]
[col="<,<"]
|====
|Task ID|Description
|A|ABC
|B|DEF
|====

File test.adoc:

:doc-type: book
:author: I's m
:email: [email protected]
:revnumber: 1.0
:revdate: {docdatetime}
:bibliography-database: test.bib
:bibliography-style: ieee
:dir-tbl: ../tbl

= My first document using asciidoctor-bibliography

In cite:[test]

This works:

include::../tbl/tbl-001.adoc[]

// This does not work anymore:
// include::{dir-tbl}/tbl-001.adoc[]

[bibliography]
== References
bibliography::[]

Compiling C:\test\src>asciidoctor -r asciidoctor-bibliography test.adoc leads to the following error when uncommenting the two lines:

asciidoctor: ERROR: test.adoc: line 21: include file not found: C:/test/src/{dir-tbl}/tbl-001.adoc

The variable dir-tbl is not expanded anymore to ../tbl

Should I open a new issue on this?

from asciidoctor-bibliography.

pddzaic avatar pddzaic commented on September 5, 2024

I have created an minimal working example to show this behavior. Let's assume the following structure:

test\
  - test.adoc
  - meta.adoc
  - References.bib

where the content is as follows:

References.bib

@Misc{ref-01,
  author    = {John Doe},
  title     = {{The Book without Title}},
  date      = {2018-09},
  doi       = {abc-123-def},
  publisher = {Oxford Press},
}

@Misc{ref-02,
  title     = {{Th title of the reference}},
  date      = {2018-01},
  doi       = {XYZ-S-12345},
  publisher = {Washington Post},
}

meta.adoc

:doc-type: book
:author: John Wayne
:email: [email protected]
:revnumber: 1.0
:revdate: {docdatetime}

The first compilation of test. adoc

//include:meta.adoc[]
:author: John Wayne
:email: [email protected]
:revnumber: 1.0
:revdate: {docdatetime}
:bibliography-database: References.bib
:bibliography-style: ieee

= My first document using asciidoctor-bibliography

In cite:[ref-01] and cite:[ref-02]

[bibliography]
== References
bibliography::[]

works fine.

This content of test.adoc

include:meta.adoc[]
:bibliography-database: References.bib
:bibliography-style: ieee

= My first document using asciidoctor-bibliography

In cite:[ref-01] and cite:[ref-02]

[bibliography]
== References
bibliography::[]

leads to an error:

Failed to load AsciiDoc document - Option :bibliography-database: is mandatory.
A bibliographic database is required.
  Use --trace for backtrace

The same error with meta.adoc:

:doc-type: book
:author: John Wayne
:email: [email protected]
:revnumber: 1.0
:revdate: {docdatetime}
:bibliography-database: References.bib
:bibliography-style: ieee

and adoc.test:

include:meta.adoc[]

= My first document using asciidoctor-bibliography

In cite:[ref-01] and cite:[ref-02]

[bibliography]
== References
bibliography::[]

from asciidoctor-bibliography.

neontapir avatar neontapir commented on September 5, 2024

@pddzaic, thank you for reproducing the bug, that's amazing!

For anyone investigating, I confirmed the error also happens when the include macro in test.adoc follows the variable definitions, which is the typical use case.

from asciidoctor-bibliography.

paolobrasolin avatar paolobrasolin commented on September 5, 2024

@neontapir and @pddzaic thanks again for the report and the sample files!

I just released 0.10.3 to fix this issue.
If you have the chance to test it, please let us know whether that works correctly for you too! 😄

from asciidoctor-bibliography.

paolobrasolin avatar paolobrasolin commented on September 5, 2024

Thanks for the report @pddzaic. I already narrowed down the problem and opened #109.

from asciidoctor-bibliography.

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.