summaryrefslogtreecommitdiffstats
path: root/l10n/es_MX.json
diff options
context:
space:
mode:
Diffstat (limited to 'l10n/es_MX.json')
-rw-r--r--l10n/es_MX.json11
1 files changed, 11 insertions, 0 deletions
diff --git a/l10n/es_MX.json b/l10n/es_MX.json
index 3fa73c0a7..9326cf644 100644
--- a/l10n/es_MX.json
+++ b/l10n/es_MX.json
@@ -104,6 +104,17 @@
"Undo delete feed" : "Deshacer borrar fuente",
"Rename" : "Renombrar",
"Menu" : "Menú",
+ "Unpin from top" : "Desanclar a la parte superior",
+ "Pin to top" : "Anclar a la parte superior",
+ "Newest first" : "Más reciente primero",
+ "Oldest first" : "Más antiguo primero",
+ "Default order" : "Ordenamiento predeterminado",
+ "Enable full text" : "Habilitar texto completo",
+ "Disable full text" : "Deshabilitar texto completo",
+ "Mark updated unread" : "Marcar actualizados como no leídos",
+ "Ignore updated" : "Ignorar actualizados",
+ "Delete" : "Borrar",
+ "Mark read" : "Marcar como leído",
"Dismiss" : "Descartar",
"Collapse" : "Colapsar",
"Deleted folder" : "Borrar carpeta",
t: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
mod v1;
mod v2;

/// Configuration as described by the instance of an admonition in markdown.
///
/// This structure represents the configuration the user must provide in each
/// instance.
#[derive(Debug, PartialEq)]
pub(crate) struct InstanceConfig {
    pub(crate) directive: String,
    pub(crate) title: Option<String>,
    pub(crate) additional_classnames: Vec<String>,
    pub(crate) collapsible: Option<bool>,
}

/// Extract the remaining info string, if this is an admonition block.
fn admonition_config_string(info_string: &str) -> Option<&str> {
    const ADMONISH_BLOCK_KEYWORD: &str = "admonish";

    // Get the rest of the info string if this is an admonition
    if info_string == ADMONISH_BLOCK_KEYWORD {
        return Some("");
    }

    match info_string.split_once(' ') {
        Some((keyword, rest)) if keyword == ADMONISH_BLOCK_KEYWORD => Some(rest),
        _ => None,
    }
}

impl InstanceConfig {
    /// Returns:
    /// - `None` if this is not an `admonish` block.
    /// - `Some(InstanceConfig)` if this is an `admonish` block
    pub fn from_info_string(info_string: &str) -> Option<Result<Self, String>> {
        let config_string = admonition_config_string(info_string)?;

        // If we succeed at parsing v2, return that. Otherwise hold onto the error
        let config_v2_error = match v2::from_config_string(config_string) {
            Ok(config) => return Some(Ok(config)),
            Err(config) => config,
        };

        Some(if let Ok(config) = v1::from_config_string(config_string) {
            // If we succeed at parsing v1, return that.
            Ok(config)
        } else {
            // Otherwise return our v2 error.
            Err(config_v2_error)
        })
    }
}

#[cfg(test)]
mod test {
    use super::*;
    use pretty_assertions::assert_eq;

    #[test]
    fn test_from_info_string() {
        // Not admonition blocks
        assert_eq!(InstanceConfig::from_info_string(""), None);
        assert_eq!(InstanceConfig::from_info_string("adm"), None);
        // v1 syntax is supported back compatibly
        assert_eq!(
            InstanceConfig::from_info_string("admonish note.additional-classname")
                .unwrap()
                .unwrap(),
            InstanceConfig {
                directive: "note".to_owned(),
                title: None,
                additional_classnames: vec!["additional-classname".to_owned()],
                collapsible: None,
            }
        );
        // v2 syntax is supported
        assert_eq!(
            InstanceConfig::from_info_string(r#"admonish title="Custom Title" type="question""#)
                .unwrap()
                .unwrap(),
            InstanceConfig {
                directive: "question".to_owned(),
                title: Some("Custom Title".to_owned()),
                additional_classnames: Vec::new(),
                collapsible: None,
            }
        );
    }
}