Giter Club home page Giter Club logo

pandoc-elements-selectors's People

Contributors

bpj avatar

Watchers

 avatar  avatar

pandoc-elements-selectors's Issues

Less Perlish sigils?

In light of the possibility that this syntax might get used in a non-Perl context it might be a good idea to replace the blatantly Perlish sigils & and % with something else. As per #1 I'm thinking of ; for properties (similar to : for type) and , for attributes (similar to . for class). Personally I have nothing against Perlish sigils, but others might, and I'm thinking that & might be used to more clearly show that selector expressions are ANDed together, perhaps opening the door for making whitespace totally insignificant outside strings and regexes. OTOH this similarity may be a drawback, making the sigils and their functions easier to confuse.

Terminology: "property" instead of "method"

Perhaps the description should talk (more) of properties than of methods since the distinction which matters from a Pandoc (rather than Perl or specifically Pandoc::Elements) perspective is between attributes (the things which go within curly brackets after some Pandoc constructs) and other properties of elements. Perhaps the sigil could also be changed to ;.

Shell style wildcards instead of or alongside regular expressions?

Shell style wildcards instead of or alongside regular expressions?

Perhaps it would be more user friendly to use shell (Unix) style wildcard syntax as per Regexp::Wildcards instead of or in addition to regular expressions.

Pros:

  • Non-programmer users familiar with the command line may not know regex but they will know at least the basics of wildcard.

  • Wildcard-to-regex rewriting will be relatively easy to implement in various languages, while differences between regex flavors may pose a problem.

  • It is probably harder to write an invalid wildcard expression than to write an invalid regex!

Cons:

  • Not as powerful as regex. (May be a good thing, and not a problem if regex is also supported!)
  • Must probably be internally compiled into a regex regardless of language.
  • The implementation of Regexp::Wildcards may be clunky and slow compared to what is possible with only Unix-style wildcards and post-5.10 Perl in mind so we may need/want to reimplement.

I'm thinking that wildcard would use [...] as delimiters as opposed to {...} for regex, so we may have both!

'Link &url~[*wikipedia.org*]' # con: implicit start/end anchors
'Link &url~{wikipedia\.org}'  # con: must escape dot

Support the `i` (case insensitive) modifier with glob patterns?

Would it be a good idea to support the i (case insensitive) modifier with glob patterns so that one could write e.g. %[foo]i rather than %[{Foo,Foo,foo}] (although this would match fOO, foO etc. as well)?

Comments/upvotes/downvotes are hereby requested!

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.