Dépôt des squelettes
This commit is contained in:
parent
a5e42fb701
commit
0ccb338e85
11
README.md
11
README.md
@ -1,3 +1,10 @@
|
||||
# scrutariexport_librealire
|
||||
# Plugin d'export au format ScrutariData pour le site librealire.org
|
||||
|
||||
Export au format ScrutariData pour le site librealire.org
|
||||
Ce plugin contient les squelettes nécessaires à l'exportation au format XML ScrutariData de la structure du site librealire.org
|
||||
|
||||
Le plugin propose deux exports différents :
|
||||
- la totalité des transcriptions (spip.php?page=scrutari_info_totalite)
|
||||
- uniquement les transcriptions des émissions de Libre à vous (spip.php?page=scrutari_info_emissions)
|
||||
|
||||
|
||||
Le format ScrutariData est décrit ici : https://www.scrutari.net/dokuwiki/scrutaridata:index
|
||||
|
16
paquet.xml
Normal file
16
paquet.xml
Normal file
@ -0,0 +1,16 @@
|
||||
<paquet
|
||||
prefix="scrutariexport_librealire"
|
||||
categorie="squelette"
|
||||
version="1.0.0"
|
||||
etat="stable"
|
||||
compatibilite="[3.2.8;4.1.*]"
|
||||
>
|
||||
<nom>+ APRIL Export au format ScrutariData pour Libre à Lire</nom>
|
||||
|
||||
<auteur>collectif APRIL</auteur>
|
||||
|
||||
<chemin path="squelettes" />
|
||||
<chemin path="" />
|
||||
|
||||
</paquet>
|
||||
|
31
scrutariexport_librealire_fonctions.php
Normal file
31
scrutariexport_librealire_fonctions.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
if (!defined('_ECRIRE_INC_VERSION')) {
|
||||
return;
|
||||
}
|
||||
|
||||
function filtre_scrutari_attr($texte) {
|
||||
$result = "";
|
||||
$array = explode("\n", $texte);
|
||||
for($i = 0; $i < count($array); $i++) {
|
||||
$value = trim($array[$i]);
|
||||
if (strlen($value) > 0) {
|
||||
$result .= "<val>".$value."</val>\n";
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
function filtre_scrutari_textebrut($texte) {
|
||||
$u = $GLOBALS['meta']['pcre_u'];
|
||||
$texte = str_replace(" ", " ", $texte);
|
||||
$texte = preg_replace('/\s+/S' . $u, " ", $texte);
|
||||
$texte = str_replace("<br/>", "\n\n", $texte);
|
||||
$texte = preg_replace("/<(p|br|li|h[1-6]|dd|dt)( [^>]*)?" . ">/iS", "\n\n", $texte);
|
||||
$texte = preg_replace("/^\n+/", "", $texte);
|
||||
$texte = preg_replace("/\n+$/", "", $texte);
|
||||
$texte = preg_replace("/\n +/", "\n", $texte);
|
||||
$texte = supprimer_tags($texte);
|
||||
$texte = filtrer_entites($texte);
|
||||
$texte = htmlspecialchars($texte, ENT_XML1 | ENT_QUOTES);
|
||||
return $texte;
|
||||
}
|
6
squelettes/scrutari_data_corpus_transcription.html
Normal file
6
squelettes/scrutari_data_corpus_transcription.html
Normal file
@ -0,0 +1,6 @@
|
||||
<corpus corpus-name="transcription">
|
||||
<corpus-metadata>
|
||||
<phrase name="title">
|
||||
<label xml:lang="fr">Transcriptions</label>
|
||||
</phrase>
|
||||
</corpus-metadata>
|
16
squelettes/scrutari_data_debut.html
Normal file
16
squelettes/scrutari_data_debut.html
Normal file
@ -0,0 +1,16 @@
|
||||
[(#HTTP_HEADER{Content-type: text/xml[; charset=(#CHARSET)]})]<?xml version="1.0"[ encoding="(#CHARSET)"]?>
|
||||
<base>
|
||||
<base-metadata>
|
||||
<authority-uuid>april.org</authority-uuid>
|
||||
<base-name>librealire</base-name>
|
||||
<phrase name="title">
|
||||
<label xml:lang="fr">Libre à lire</label>
|
||||
</phrase>
|
||||
<phrase name="longtitle">
|
||||
<label xml:lang="fr">Libre à lire, le site du groupe Transcriptions de l'April</label>
|
||||
</phrase>
|
||||
<lang-ui>
|
||||
<lang>fr</lang>
|
||||
</lang-ui>
|
||||
<base-icon>https://static.scrutari.net/april_librealire.png</base-icon>
|
||||
</base-metadata>
|
18
squelettes/scrutari_data_fiches_transcription.html
Normal file
18
squelettes/scrutari_data_fiches_transcription.html
Normal file
@ -0,0 +1,18 @@
|
||||
<BOUCLE_emmissions(ARTICLES){id_rubrique=1}>
|
||||
<fiche fiche-id="#ID_ARTICLE">
|
||||
<titre>[(#TITRE|supprimer_numero|scrutari_textebrut)]</titre>
|
||||
[<date>(#DATE|affdate{'Y-m-d'})</date>]
|
||||
<lang>fr</lang>
|
||||
<href>https://www.librealire.org/[(#URL_ARTICLE)]</href>
|
||||
<B_personnes>
|
||||
<attr ns="april" key="personnes">
|
||||
<BOUCLE_personnes(MOTS){id_article}{id_groupe=5}>
|
||||
<val>[(#TITRE|scrutari_textebrut)]</val>
|
||||
</BOUCLE_personnes>
|
||||
</attr>
|
||||
</B_personnes>
|
||||
<attr ns="april" key="transcription">
|
||||
[(#TEXTE|scrutari_textebrut|scrutari_attr)]
|
||||
</attr>
|
||||
</fiche>
|
||||
</BOUCLE_emmissions>
|
18
squelettes/scrutari_data_fiches_transcription_emissions.html
Normal file
18
squelettes/scrutari_data_fiches_transcription_emissions.html
Normal file
@ -0,0 +1,18 @@
|
||||
<BOUCLE_emmissions(ARTICLES){id_mot=61}>
|
||||
<fiche fiche-id="#ID_ARTICLE">
|
||||
<titre>[(#TITRE|supprimer_numero|scrutari_textebrut)]</titre>
|
||||
[<date>(#DATE|affdate{'Y-m-d'})</date>]
|
||||
<lang>fr</lang>
|
||||
<href>https://www.librealire.org/[(#URL_ARTICLE)]</href>
|
||||
<B_personnes>
|
||||
<attr ns="april" key="personnes">
|
||||
<BOUCLE_personnes(MOTS){id_article}{id_groupe=5}>
|
||||
<val>[(#TITRE|scrutari_textebrut)]</val>
|
||||
</BOUCLE_personnes>
|
||||
</attr>
|
||||
</B_personnes>
|
||||
<attr ns="april" key="transcription">
|
||||
[(#TEXTE|scrutari_textebrut|scrutari_attr)]
|
||||
</attr>
|
||||
</fiche>
|
||||
</BOUCLE_emmissions>
|
9
squelettes/scrutari_info_emissions.html
Normal file
9
squelettes/scrutari_info_emissions.html
Normal file
@ -0,0 +1,9 @@
|
||||
[(#HTTP_HEADER{Content-type: text/xml[; charset=(#CHARSET)]})]<?xml version="1.0"[ encoding="(#CHARSET)"]?>
|
||||
<info>
|
||||
<date>[(#DATE|affdate{'Y-m-d'})]</date>
|
||||
<scrutaridata-url>spip.php?page=scrutari_data_debut</scrutaridata-url>
|
||||
<scrutaridata-url>spip.php?page=scrutari_data_corpus_transcription</scrutaridata-url>
|
||||
<scrutaridata-url>spip.php?page=scrutari_data_fiches_transcription_emissions</scrutaridata-url>
|
||||
<xml-fragment><![CDATA[</corpus>]]></xml-fragment>
|
||||
<xml-fragment><![CDATA[</base>]]></xml-fragment>
|
||||
</info>
|
9
squelettes/scrutari_info_totalite.html
Normal file
9
squelettes/scrutari_info_totalite.html
Normal file
@ -0,0 +1,9 @@
|
||||
[(#HTTP_HEADER{Content-type: text/xml[; charset=(#CHARSET)]})]<?xml version="1.0"[ encoding="(#CHARSET)"]?>
|
||||
<info>
|
||||
<date>[(#DATE|affdate{'Y-m-d'})]</date>
|
||||
<scrutaridata-url>spip.php?page=scrutari_data_debut</scrutaridata-url>
|
||||
<scrutaridata-url>spip.php?page=scrutari_data_corpus_transcription</scrutaridata-url>
|
||||
<scrutaridata-url>spip.php?page=scrutari_data_fiches_transcription</scrutaridata-url>
|
||||
<xml-fragment><![CDATA[</corpus>]]></xml-fragment>
|
||||
<xml-fragment><![CDATA[</base>]]></xml-fragment>
|
||||
</info>
|
Loading…
Reference in New Issue
Block a user