Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow passing creator attributes #6

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

theefer
Copy link

@theefer theefer commented Feb 7, 2011

Minor changes to allow passing opf:role and opf:file-as attributes for the creator OPF tag in the DSL, e.g.:

creator "Dan Brown", :file_as => "Brown, Dan", :role => 'aut' # author
creator "Jimmy Doe", :role => 'trl' # translator

Also added a standard Gemfile, as I had trouble installing Jewelry to build a new gem.

@jugyo
Copy link
Owner

jugyo commented Feb 9, 2011

please wait.

@jugyo
Copy link
Owner

jugyo commented Feb 9, 2011

Currently, you can to do that as following:

creator :value => 'Jane Austen', 'opf:file-as' => 'Austen, Jane'

@theefer
Copy link
Author

theefer commented Feb 9, 2011

Thanks for your feedback, I missed that indeed.

However, is there any reason not to use a syntax like :

creator 'Jane Austen', 'opf:file-as' => 'Austen, Jane'

i.e. capture any extra Hash argument and map it to attributes on the element, with the value always as the explicit (required) first argument ? I guess an explicit :value => ... would make sense if :value was optional (but it's not, the OPF builder expects it) or if multiple values where possible (not the case currently).

That would be a first step toward a more concise DSL?

Then, as an optional second step, a known mapping of Symbol => opf attribute String could be managed by OPF for each field, like it's already doing for :scheme -> 'opf:scheme' for identifiers?

@jugyo
Copy link
Owner

jugyo commented Feb 9, 2011

That's right.
But I have no time to do that now :(

@theefer
Copy link
Author

theefer commented Feb 9, 2011

I'm happy to prepare a reworked patch for this, just wanted to know if you agreed on the general idea.

I'll keep you posted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants