Comments (8)
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.
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.
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.
Looking at the extras repo, we have the by type here:
And another one here (this one actually does group-by year, right?):
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.
@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.
@inukshuk: bibliography_hdp.rb does group it by year.
from jekyll-scholar.
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.
See #121
from jekyll-scholar.
Related Issues (20)
- GitHub button just like HTML, PDF
- Add space after index in IEEE style HOT 4
- Query to filter entries based on the value of a field HOT 1
- Backlinks? HOT 1
- Sort entries in a query HOT 2
- Build error when used with github-metadata HOT 2
- Reduce jekyll-scholar build time? HOT 2
- Booktitle of new type fields
- Liquid Exception: undefined method `exists?' for File:Class in _pages/... HOT 1
- --suppress_author flag replaces author with title HOT 2
- Individually linked citations in multiple citations HOT 5
- Security?
- How to cite a paper/book in my posts HOT 4
- Be able to change style files / use more than one style file. HOT 2
- details_link does not allow variable input HOT 1
- Jekyll Scholar on macOS 10.13.6: Tried to create Proc object without a block HOT 4
- Academicpages/minimal mistakes compatibility HOT 6
- Completely disable details link generation for a page HOT 2
- How to provide the raw bib entry in a small popup or drop down? HOT 1
- Highlight one or more authors HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jekyll-scholar.