Commit cfe788df authored by Denis Salem's avatar Denis Salem
Browse files

Fix issue #20

parent 744d5477
......@@ -170,14 +170,16 @@
DONE | Add CodeHighlightInclude
DONE | Reorganize themes dependencies in setup.
DONE | Print out what's going on while FTP transfert.
WIP | Add relevant templates for themes.
WIP | Client-side search engine.
WIP | Add definition in documentation for optional fields in blog configuration.
DONE | Change nomenclature: Most of the usual patterns are changed. Fix doc.
DONE | Documenter le type des métadonnées: list, str ou dict
DONE | Fix chapters rendering (only first level sub-chapter were rendered)
DONE | Fix list CSS in academik
TODO | Calling pattern in wrong context should trigger explicit error instead of UnknownPattern
DONE | Add definition in documentation for optional fields in blog configuration.
# ver2.0.1
WIP | Add relevant templates for themes.
WIP | Client-side search engine.
TODO | (issue #20) Calling pattern in wrong context should trigger explicit error instead of UnknownPattern
# version 2.1.x
TODO | Replace as much as possible usage of list with tuple.
......
......@@ -17,4 +17,4 @@
# You should have received a copy of the GNU General Public License
# along with VenC. If not, see <http://www.gnu.org/licenses/>.
venc_version = "2.0.0"
venc_version = "2.0.1"
......@@ -129,7 +129,7 @@ def setup_pattern_processor(pattern_map):
processor.blacklist.append("Escape")
return processor
def process_non_contextual_patterns(pattern_processor, theme):
def process_non_contextual_patterns(pattern_processor, theme, patterns_map):
for entry in datastore.get_entries():
if hasattr(entry, "markup_language"):
markup_language = getattr(entry, "markup_language")
......@@ -158,6 +158,9 @@ def process_non_contextual_patterns(pattern_processor, theme):
pattern_processor.process(pp)
pp.replace_needles()
for pattern_name in patterns_map.non_contextual["entries"].keys():
pattern_processor.del_function(pattern_name)
pattern_processor.process(theme.header)
theme.header.replace_needles()
......@@ -187,7 +190,7 @@ def export_blog(argv=list()):
notify("├─ "+messages.pre_process)
process_non_contextual_patterns(pattern_processor, theme)
process_non_contextual_patterns(pattern_processor, theme, patterns_map)
# cleaning directory
shutil.rmtree("blog", ignore_errors=False, onerror=rm_tree_error_handler)
......
......@@ -59,7 +59,7 @@ class Messages:
for_unknown_value="For: Value {0} isn't defined."
recursive_for_unknown_value="RecursiveFor: Value {0} isn't defined."
not_enough_args="Missing arguments (expected {0}, got {1})."
unknown_pattern="The pattern '{0}'doesn't exists."
unknown_pattern="The pattern '{0}'doesn't exists or isn't used in the right place."
unknown_contextual="Contextual variable {0} doesn't exists."
in_ressource="In ressource '{0}'."
something_goes_wrong_return_empty_string="An error occurs. Replacement with an empty string."
......
......@@ -57,7 +57,7 @@ class Messages:
missing_mandatory_field_in_entry="Le champ '{0}' dans l'entrée numéro {1} est manquant."
recursive_for_unknown_value="RecursiveFor: La valeur {0} n'existe pas."
not_enough_args="Paramétres manquants (attendus {0}, reçus {1})."
unknown_pattern="Le motif '{0}' n'existe pas."
unknown_pattern="Le motif '{0}' n'existe pas ou n'est pas utilisé au bon endroit."
unknown_contextual="La variable contextuel {0} n'existe pas."
in_ressource="Dans la ressource '{0}'."
something_goes_wrong_return_empty_string="Une erreur s'est produite. Remplacement pas une chaine de caractère vide."
......
......@@ -91,7 +91,6 @@ class PatternsMap():
"Audio" : theme.get_audio,
"Table" : table
}
}
self.non_contextual_entries_keys = self.non_contextual["entries"].keys()
......
......@@ -445,7 +445,7 @@ class Processor():
self.ignore_patterns = False
self.include_file_called = False
# Why the fuck there is only one pattern here?
# TODO: Why the fuck there is only one pattern here?
elif current_pattern == "SetColor":
new_chunk = pre_processed.keep_appart_from_markup_indexes_append(
False,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment