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

#370 (styling not addressed) #383

Open
wants to merge 1 commit into
base: build_cleanup
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions scripts/generate_glossary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
end

definition=nil
examples=[]
if opts[:testing]
definition="placeholder definition"
else
Expand Down Expand Up @@ -131,14 +132,23 @@
definition=nil
$stderr.puts %Q{NO JBOVLASTE DEFINITION FOR "#{word}" FOUND!}
end
jbovlaste_tree.xpath(%Q{//valsi[@word="#{word}"]}).xpath(".//examples/example").each do |example|
source = Nokogiri::XML.parse(example.to_s).xpath("//source").text.strip
translation = Nokogiri::XML.parse(example.to_s).xpath(%Q{//target[@language="English"]/translation}).text.strip
examples.push("<para>#{source} — #{translation}</para>")
end
end
if examples.length() > 0
examples = "\n #{examples.join("\n ")}"
else
examples=""
end

if definition
gfh.puts %Q{
<glossentry xml:id="valsi-#{slug}">
<glossterm>#{word}</glossterm>
<glossdef>
<para>#{definition}</para>
<para>#{definition}</para>#{examples}
</glossdef>
</glossentry>
}
Expand Down