Skip to content

Commit

Permalink
Add UI controls to CLI options in reader and writer.
Browse files Browse the repository at this point in the history
Fixes #33.
  • Loading branch information
gkellogg committed Mar 4, 2024
1 parent fb11c7e commit d2c5c7c
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
24 changes: 24 additions & 0 deletions example-files/property-copying.html
@@ -0,0 +1,24 @@
<div vocab="http://schema.org/">
<div resource="#muse" typeof="rdfa:Pattern">
<link property="image" href="Muse1.jpg"/>
<link property="image" href="Muse2.jpg"/>
<link property="image" href="Muse3.jpg"/>
<span property="name">Muse</span>
</div>

<p typeof="MusicEvent">
<link property="rdfa:copy" href="#muse"/>
Muse at the United Center.
<time property="startDate" datetime="2013-03-03">March 3rd 2013</time>,
<a property="location" href="#united">United Center, Chicago, Illinois</a>
...
</p>

<p typeof="MusicEvent">
<link property="rdfa:copy" href="#muse"/>
Muse at the Target Center.
<time property="startDate" datetime="2013-03-07">March 7th 2013</time>,
<a property="location" href="#target">Target Center, Minneapolis, Minnesota</a>
...
</p>
</div>
10 changes: 8 additions & 2 deletions lib/rdf/rdfa/reader.rb
Expand Up @@ -251,18 +251,24 @@ def self.options
RDF::CLI::Option.new(
symbol: :vocab_expansion,
datatype: TrueClass,
default: false,
control: :checkbox,
on: ["--vocab-expansion"],
description: "Perform OWL2 expansion on the resulting graph.") {true},
RDF::CLI::Option.new(
symbol: :host_language,
datatype: %w(xml xhtml1 xhtml5 html4 svg),
on: ["--host-language HOSTLANG", %w(xml xhtml1 xhtml5 html4 svg)],
datatype: %w(xml xhtml1 xhtml5 html4 html5 svg),
default: :html5,
control: :select,
on: ["--host-language HOSTLANG", %w(xml xhtml1 xhtml5 html4 html5 svg)],
description: "Host Language. One of xml, xhtml1, xhtml5, html4, or svg") do |arg|
arg.to_sym
end,
RDF::CLI::Option.new(
symbol: :rdfagraph,
datatype: %w(output processor both),
default: :output,
control: :select,
on: ["--rdfagraph RDFAGRAPH", %w(output processor both)],
description: "Used to indicate if either or both of the :output or :processor graphs are output.") {|arg| arg.to_sym},
]
Expand Down
3 changes: 3 additions & 0 deletions lib/rdf/rdfa/writer.rb
Expand Up @@ -82,6 +82,9 @@ def self.options
symbol: :lang,
datatype: String,
on: ["--lang"],
datatype: TrueClass,
default: false,
control: :checkbox,
description: "Output as root @lang attribute, and avoid generation _@lang_ where possible."),
]
end
Expand Down

0 comments on commit d2c5c7c

Please sign in to comment.