Giter VIP home page Giter VIP logo

Comments (2)

ronaldtse avatar ronaldtse commented on September 5, 2024

@shahryareiv that's indeed an oft-encountered problem with Asciidoctor -- for example, a control phrase that uses underscores or other syntax symbols will get cut off with a linebreak, so it's not a specific issue with asciidoctor-bibliography.

We could possibly support the suggested syntax of cite:[key1;key2;key3]. Thoughts @paolobrasolin @opoudjis ?

from asciidoctor-bibliography.

paolobrasolin avatar paolobrasolin commented on September 5, 2024

Thanks for your feedback @shahryareiv!

I initially though about using semicolons as separators myself, but I decided not to in order to offer a syntax reminiscent of other common macros to target a specific indices within a multiple citations:

cite:foo_index[Aa2017]+bar_index[Bb2017]

Ignoring whitespace is technically easy but refraining from it avoided ambiguity in edge cases, e.g. when you'd want a literal + [something] after a citation. It's a bit far fetched, but still possible.

Furthermore, allowing to break the line after + would create a behaviour diverging from the default expected one.

Another point in favour of not allowing line breaks could be that these are an inline macros - but I do realise they can get too long to maintain very quickly.

A solution might be as follows:

// single citation
cite:[foo_key]
// single citation w/ non default target 
cite:my_index[foo_key]
// single citation w/ non default target (alt. syntax) 
cite:[foo_key, target=my_index]
// multiple citations
cite:[foo_key; bar_key]
// multiple citations w/ common non default target
cite:my_index[foo_key; bar_key]
// multiple citations w/ common non default target and a local target override
cite:my_index[foo_key; bar_key; baz_key, target=your_index]

All this while allowing for arbitrary whitespace in the attribute list in canonical way.

On top of that, we could also allow for line breaks within the square brackets; this would be a non canonical behaviour for an inline macro, but might greatly improve its usability.

(If we decide to implement this I'd keep the +-concatenation but drop it at the next major; this syntax seems a bit more reasonable.)

@ronaldtse Any thoughts? My only concern is that allowing line breaks inside the attribute list of an inline macro is a non canonical behaviour.

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.