Giter Site home page Giter Site logo

Comments (8)

ashinkarov avatar ashinkarov commented on August 19, 2024

I wouldn't be against extra tags, assuming that they would be implemented exactly as an alias for the original tag with query. At this point my knowledge in the area of jekyll/ruby finishes, so @inukshuk, you'll have to clarify things here.

Ideally, we just need something like another layer of text preprocessing, where bibliographyXX would be expanded to 'bibliography -q XX', but I don't really know if it would be doable like that.

Alternatively, we need to inherit from the bibliography tag and add one line in the constructor which filters entries with a certain filter. Again, I am not sure if jekyll would be all right when you inherit a tag, may be it is not possible.

from jekyll-scholar.

inukshuk avatar inukshuk commented on August 19, 2024

I agree, creating 'alias' tags for reasonable parameter combinations sounds good to me. The main concern here is maintainability, as @ashinkarov already points out. Both meta-programming or inheritance seem to be viable approaches to me – give it a go if you like, otherwise I'll take a look at it as soon as possible.

Meanwhile, let's compile a list of which aliases we actually want to have and which parameters we still need. I think an alias only makes sense when the user saves more than one parameter in the process. Furthermore, IIRC sort and order are currently not supported as parameters (only in main configuration) so we should add them as parameters first. Finally, didn't you actually group the bibliography together (e.g., by year)? This is something we might want to add as well, a --group-by parameter.

from jekyll-scholar.

ashinkarov avatar ashinkarov commented on August 19, 2024

Sure, I agree. Let's wait for @hdpatel to reply, it was his initiative, so we cannot really decide without him :) Then as for the list, if I understand correctly we are talking about:

  • bibliography_by_type type <options>
  • bibliography_by_year year <options>
  • bibliography_by_author name <options>

Anything else?
Then, I'll wait for your parameters, and I am happy to implement aliasing. Could you point me to some meta-programming techniques you would have in mind regarding this issue?

from jekyll-scholar.

inukshuk avatar inukshuk commented on August 19, 2024

Looking at the extras repo, we have the by type here:

https://github.com/hdpatel/jekyll-scholar-extras/blob/master/lib/jekyll/scholar/extras/bibliography_bytype.rb

And another one here (this one actually does group-by year, right?):

https://github.com/hdpatel/jekyll-scholar-extras/blob/master/lib/jekyll/scholar/extras/bibliography_hdp.rb

I think we'll have to implement, sort and order parameters first (easy), then a group by (harder, because it involves minimal templating) and we should be set to go.

As far as the aliasing, I think the important thing is that it really only uses the original tags with set parameters to keep the maintenance costs at a minimum. To ensure that this is actually the case, we could try to generate the tags using a hash which contains the appropriate parameters. So I think I would put all the parameters into a hash and then loop through them generating the Tag classes on the fly. This is really easy in Ruby, here some pseudo-code to get the idea:

config = { :bibliography_by_type => { sort: 'type' ... } ... }

config.each do |tag, options|
  Jekyll::Scholar.const_set tag.camelize, Class.new(Liquid::Tag) do
    # implement initialize and render here
  end
end

from jekyll-scholar.

 avatar commented on August 19, 2024

@inukshuk: I am not familiar with aliasing in the ruby context, but I certainly feel that there should be a clean contract in how the meta-tags interact with the actual bibliography tag. Consequently, if any additions are done to the tag itself, then the parameter ordering and such in the meta-tag does not have to be changed.

Sort-and-order is quite important since that is the way I'd expect most people organize their references.

@ashinkarov: You seem to have the most important ones there. Just a suggestion -- within each of these you may have to come up with a way to order it. For example, within the by_year, you have to decide whether journals come first, then conference proceedings and so on. Perhaps one could specify the order?

from jekyll-scholar.

 avatar commented on August 19, 2024

@inukshuk: bibliography_hdp.rb does group it by year.

from jekyll-scholar.

 avatar commented on August 19, 2024

Another sort order that might be useful is by publication venue type. I find that sometimes it is useful to list all the publications at a particular venue. This would pretty much be a string match of the booktitle?

from jekyll-scholar.

inukshuk avatar inukshuk commented on August 19, 2024

See #121

from jekyll-scholar.

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.