Skip to content

Commit

Permalink
HXL-CPLP/forum#58, hapi-t9n-alpha (#13), mvp-l10n-schemas (#7): ok, n…
Browse files Browse the repository at this point in the history
…esse ritimo eventualmente vai estar pronto para estilização visual mais significativa
  • Loading branch information
fititnt committed Jun 8, 2021
1 parent a4d211d commit e658790
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 67 deletions.
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ end

gem 'html-proofer'

## vscode-solargraph
# @see https://github.com/castwide/vscode-solargraph
# gem install --user-install solargraph

# _[por] rubocop é tão racista que obriga re-habilitar
# AsciiComments [por]_
# rubocop:enable RubocopIsRacistAndIcanProveIt/AsciiComments
2 changes: 1 addition & 1 deletion _config_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ url: ""
# @see https://jekyllrb.com/docs/configuration/liquid/
liquid:
# error_mode: warn
error_mode: strict
# error_mode: strict
# strict_variables: true
strict_filters: true
40 changes: 20 additions & 20 deletions _plugins/hapi/drops/globum_drop.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,28 +41,28 @@ def inspect
JSON.pretty_generate(@optionem)
end

def to_s
# optionem_explanandum = []
# @optionem.each_key do |clavem|
# optionem_item = ''
# if @optionem[clavem].length.positive? && @optionem[clavem][0] && @optionem[clavem][0].keys
# optionem_item = @optionem[clavem][0].keys.join(', ')
# # puts @optionem[clavem][0].inspect
# optionem_explanandum.append("#{clavem} => {dēscendēns => #{@optionem[clavem].length}, optionem => #{optionem_item}}")
# else
# optionem_explanandum.append("#{clavem} => {dēscendēns => #{@optionem[clavem].length}}")
# end
# # optionem_explanandum.append("#{clavem} => {dēscendēns => #{@optionem[clavem].length}, optionem => #{optionem_item}}")
# end
# def to_s
# # optionem_explanandum = []
# # @optionem.each_key do |clavem|
# # optionem_item = ''
# # if @optionem[clavem].length.positive? && @optionem[clavem][0] && @optionem[clavem][0].keys
# # optionem_item = @optionem[clavem][0].keys.join(', ')
# # # puts @optionem[clavem][0].inspect
# # optionem_explanandum.append("#{clavem} => {dēscendēns => #{@optionem[clavem].length}, optionem => #{optionem_item}}")
# # else
# # optionem_explanandum.append("#{clavem} => {dēscendēns => #{@optionem[clavem].length}}")
# # end
# # # optionem_explanandum.append("#{clavem} => {dēscendēns => #{@optionem[clavem].length}, optionem => #{optionem_item}}")
# # end

# puts @optionem['api_gid_xdefallo']
# optionem_explanandum.append(@optionem['api_gid_xdefallo'].to_s)
# optionem_explanandum.append(@optionem['api_gid_xdefallo'].to_s)
# # puts @optionem['api_gid_xdefallo']
# # optionem_explanandum.append(@optionem['api_gid_xdefallo'].to_s)
# # optionem_explanandum.append(@optionem['api_gid_xdefallo'].to_s)

# "#{HapiDrop} @item=#{@optionem.keys} #{optionem_num}"
"<{#{self.class} @item=[#{@optionem.keys}]}>"
# "#{HapiDrop} @item=[#{optionem_explanandum.join(', ')}]"
end
# # "#{HapiDrop} @item=#{@optionem.keys} #{optionem_num}"
# "[\# aaaaaaaaaa #{self.class} @item=[#{@optionem.keys}]]"
# # "#{HapiDrop} @item=[#{optionem_explanandum.join(', ')}]"
# end

def gid
@optionem['gid']
Expand Down
40 changes: 29 additions & 11 deletions _plugins/hapi/hic_sunt_dracones.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def initiale_pre_render # rubocop:disable Metrics/AbcSize, Metrics/MethodLength,

# api_xdefallo = api_xdefallo?(api)
api_gid_xdefallo = api_gid_xdefallo?(api)
globum = globum_api_et_scheman?(api)
globum = globum?(api)

jekyll_data = HSD.data?

Expand Down Expand Up @@ -183,6 +183,7 @@ def pages!(pages)
end

# @deprecated
# @see _data/referens.yml#gid
def referens_gid? # rubocop:disable Metrics/AbcSize
return [] if Jekyll.sites.last.data['l10n'].nil? || \
Jekyll.sites.last.data['l10n']['referensl10n'].nil? || \
Expand All @@ -191,19 +192,36 @@ def referens_gid? # rubocop:disable Metrics/AbcSize
Jekyll.sites.last.data['l10n']['referensl10n']['gid']
end

# @see _data/referens.yml#gid
def globum? # rubocop:disable Metrics/AbcSize
return [] if Jekyll.sites.last.data['l10n'].nil? || \
Jekyll.sites.last.data['l10n']['referensl10n'].nil? || \
Jekyll.sites.last.data['l10n']['referensl10n']['gid'].nil?
def globum?(api_collectionem = nil, _schemam_collectionem = nil) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
apis = api_collectionem || api?
referens_gid = referens_gid?

Jekyll.sites.last.data['l10n']['referensl10n']['gid']
end
# puts 'oi oi '
# puts referens_gid.empty?
# puts apis.empty?
return [] if referens_gid.empty? || apis.empty?

def globum_api_et_scheman?(api_collectionem = nil, _schemam_collectionem = nil)
apis = api_collectionem || api?
# puts 'oi oi 2'

api_gid_xdefallo?(api_collectionem)
# resultatum = {}
resultatum = []

referens_gid.each do |clavem_gid, valendum|
puts "api_gid_xdefallo [#{clavem_gid}] [#{valendum}]"
res = valendum
res['collectionem_api'] = []
res['collectionem_xapi'] = []
apis.each do |api|
res['collectionem_api'].append(api) if api.gid_est?(clavem_gid)
res['collectionem_xapi'].append(api) if api.xdefallo_est? && api.gid_est?(clavem_gid)
# resultatum[clavem] = valendum
end
resultatum.append(res)
drop = Hapi::Drops::HapiGlobumDrop.new(res)
resultatum.append(drop)
end

resultatum
end

def testum
Expand Down
11 changes: 11 additions & 0 deletions _plugins/jekyll_hapi_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ class ApiPaginam < Jekyll::Page
alternativum
gid
uid
titulum
namen
xdefallo
content
dir
Expand Down Expand Up @@ -166,6 +168,15 @@ def keys
ATTRIBUTES_FOR_LIQUID
end

# TODO: remove obsolete parts
def titulum
@titulum|| @namen || @title
end

def namen
@titulum|| @namen || @title
end

# Trivia
# - 'trivium'
# - https://en.wiktionary.org/wiki/trivium#Latin
Expand Down
64 changes: 29 additions & 35 deletions documentum/mul-Zyyy/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,43 +90,37 @@ <h4>{{ item_alt.title | default: item_alt.namen }}</h4>
</article>
<article>
<h2>API per gid</h2>
{{ site.data.hapi }}
<br>
<br>
<br>
site.data.hapi.api_xdefallo
{{ site.data.hapi.api_xdefallo | inspect }}
<br>
<br>
site.data.hapi['api_gid_xdefallo']
{{ site.data.hapi['api_gid_xdefallo'] | inspect }}
<br>
<br>
<br>
site.data.hapi.api_gid_xdefallo

{{ site.data.hapi.api_gid_xdefallo | inspect }}
<br>
<br>
<br>
{% for api_gid in site.data.hapi.api_gid_xdefallo %}
{% for globum in site.data.hapi.globum %}
<article>
<h3>{{ api_gid.gid }}</h3>
<dl>
<dt>{% _🗣️ abbreviationem_XZ_URL_canonicum_nomen 🗣️_ %}</dt>
<dd><a href="{{ item_group.url }}">{{ item_group.url }}</a></dd>
</dl>
{% for item_alt in item_group.alternativum %}
{% if item_alt.url != item_group.url %}
<article>
<h4>{{ item_alt.title | default: item_alt.namen }}</h4>
<dl>
<dt>{% _🗣️ abbreviationem_XZ_URL_canonicum_nomen 🗣️_ %}</dt>
<dd><a href="{{ item_alt.url }}">{{ item_alt.url }}</a></dd>
</dl>
</article>
{% endif %}
<h3 id="api-{{ globum.gid | slugify }}">
<a href="#api-{{ globum.gid | slugify }}">🔗</a>
{{ globum.namen }}
</h3>
{% for xapi in globum.collectionem_xapi %}
<article style="padding-right: 2em; padding-left: 2em;">
<h4 id="{{ xapi.url | slugify }}">
<a href="#{{ xapi.url | slugify }}">🔗</a>
{{ xapi.uid }}
</h4>
{% for api_alt in xapi.alternativum %}
<article style="padding-right: 1em; padding-left: 1em;">
<h5 id="{{ api_alt.url | slugify }}">
<a href="#{{ api_alt.url | slugify }}">🔗</a>
{{ api_alt.title }}
</h5>
<dl>
<dt>{% _🗣️ abbreviationem_XZ_URL_canonicum_nomen 🗣️_ %}</dt>
<dd><a href="{{ api_alt.url }}">{{ api_alt.url }}</a></dd>
</dl>
<!-- {{ api_alt | inspect }} -->
</article>
{% endfor %}
<!-- {{ xapi | inspect }} -->

</article>
{% endfor %}
<!-- {{ globum | inspect }} -->
<br>
</article>
{% endfor %}
</article>
Expand Down

0 comments on commit e658790

Please sign in to comment.