-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add app/choice functionality #3
Comments
I'd like to add few ideas for this request as on the oXygen side I've implemented a similar functionality using the code templates. <note accid.ges="s" doxml.id="d28e114" dur="8" oct="4" pname="f" tstamp="3" xml:id="note_3495"/>
<note accid.ges="s" doxml.id="d28e117" dur="8" oct="4" pname="f" tstamp="3.5" xml:id="note_3501"/> becomes this Click to see the snippet
<app xml:id="app_hrd_pzr_5wb">
<lem source="#source_1" xml:id="lem_pgf_pzr_5wb">
<note accid.ges="s" doxml.id="d28e114" dur="8" oct="4" pname="f" tstamp="3" xml:id="note_3495a"/>
<note accid.ges="s" doxml.id="d28e117" dur="8" oct="4" pname="f" tstamp="3.5" xml:id="note_3501a"/>
</lem>
<rdg source="#source_1" xml:id="rdg_zfg_pzr_5wb">
<note accid.ges="s" doxml.id="d28e114" dur="8" oct="4" pname="f" tstamp="3" xml:id="note_3495b"/>
<note accid.ges="s" doxml.id="d28e117" dur="8" oct="4" pname="f" tstamp="3.5" xml:id="note_3501b"/>
</rdg>
</app> A prompt asks for Note also the following:
You may want to check it in oXygen (Preferences > Editor > Content completion > Code templates > New): Click to see the snippet
<app xml:id="app_${id}">
<lem source="${ask('Source(s) of lem? (Type if multiple)', editable_combobox, ('#source_1':'#source_1';'#source_2':'#source_2';'#source_3':'#source_3'), '#source_1')}" xml:id="lem_${id}">
${xpath_eval(
let $node := parse-xml-fragment('${selection}')/node(),
$string := serialize($node),
$pattern := '(<.*?xml:id=")(.*?)(".*?>)',
$replacement := '$1$2a$3'
return
replace($string, $pattern,$replacement)
)}
</lem>
<rdg source="${ask('Source(s) of rdg? (Type if multiple)', editable_combobox, ('#source_1':'#source_1';'#source_2':'#source_2';'#source_3':'#source_3'), '#source_1')}" xml:id="rdg_${id}">
${xpath_eval(
let $node := parse-xml-fragment('${selection}')/node(),
$string := serialize($node),
$pattern := '(<.*?xml:id=")(.*?)(".*?>)',
$replacement := '$1$2b$3'
return
replace($string, $pattern,$replacement)
)}${caret}
</rdg>
</app> |
corr-orig
<choice xml:id="choice_pvn_sbs_5wb">
<corr resp="#NMA-editors" xml:id="corr_ml5_sbs_5wb">
<note accid.ges="s" doxml.id="d28e106" dur="8" oct="4" pname="f" tstamp="1" xml:id="note_3462a"/>
<note accid.ges="s" doxml.id="d28e108" dur="8" oct="4" pname="f" tstamp="1.5" xml:id="note_3468a"/>
</corr>
<orig xml:id="orig_vl5_sbs_5wb">
<note accid.ges="s" doxml.id="d28e106" dur="8" oct="4" pname="f" tstamp="1" xml:id="note_3462b"/>
<note accid.ges="s" doxml.id="d28e108" dur="8" oct="4" pname="f" tstamp="1.5" xml:id="note_3468b"/>
</orig>
</choice> reg-orig
<choice xml:id="choice_wdn_wbs_5wb">
<reg resp="#DME-editors" type="#editorial_normalization" xml:id="reg_jks_wbs_5wb">
<note accid.ges="s" doxml.id="d28e106" dur="8" oct="4" pname="f" tstamp="1" xml:id="note_3462a"/>
<note accid.ges="s" doxml.id="d28e108" dur="8" oct="4" pname="f" tstamp="1.5" xml:id="note_3468a"/>
</reg>
<orig xml:id="orig_sks_wbs_5wb">
<note accid.ges="s" doxml.id="d28e106" dur="8" oct="4" pname="f" tstamp="1" xml:id="note_3462b"/>
<note accid.ges="s" doxml.id="d28e108" dur="8" oct="4" pname="f" tstamp="1.5" xml:id="note_3468b"/>
</orig>
</choice> (note the adding of corr-sic
<choice xml:id="choice_aks_1cs_5wb">
<corr resp="#DME-editors" xml:id="corr_lxt_1cs_5wb">
<note accid.ges="s" doxml.id="d28e106" dur="8" oct="4" pname="f" tstamp="1" xml:id="note_3462a"/>
<note accid.ges="s" doxml.id="d28e108" dur="8" oct="4" pname="f" tstamp="1.5" xml:id="note_3468a"/>
</corr>
<sic xml:id="sic_uxt_1cs_5wb">
<note accid.ges="s" doxml.id="d28e106" dur="8" oct="4" pname="f" tstamp="1" xml:id="note_3462b"/>
<note accid.ges="s" doxml.id="d28e108" dur="8" oct="4" pname="f" tstamp="1.5" xml:id="note_3468b"/>
</sic>
</choice>
|
As already mentioned but I almost forgot to write the promised issue, here it is:
One very useful function might be to help users add editorial markup. Especially beginners are struggling with adding editorial markup. mei-friend might be able to help with providing standard templates (reduces accidental typos etc.).
A user might select a certain portion of the MEI file and then ask for surrounding it with an
<app>
element while the selection will be put into the<lem>
, like:... becomes ...
Or ask where the selection should be put...
If useful, that feature might be as well expanded for common cases of
<choice>
etc.Of course, this will lead quickly to some general UI-related questions like: Should empty
@source
attributes be added automatically or not?Please, consider it more as a suggestion than a request.
The text was updated successfully, but these errors were encountered: