private IEnumerable <XmlBlock> ExtractInternal(TextReader textReader, string fileName = null) { var reader = new LineReader(textReader); while (reader.Read()) { if (!reader.Current.StartsWith("```")) { continue; } var location = new ConfigurationLocation(fileName, reader.LineNumber); var isXmlTyped = reader.Current.StartsWith("```xml", StringComparison.OrdinalIgnoreCase); var text = ReadBlock(reader); var block = new XmlBlock(text, location); try { var elements = block.GetElements(); if (!isXmlTyped && !elements.Any()) { continue; } } catch (XmlException) { if (!isXmlTyped) { continue; } } yield return(block); } }
private IEnumerable <Link> ExtractInternal(TextReader textReader, string fileName = null) { var reader = new LineReader(textReader); while (reader.Read()) { var location = new ConfigurationLocation(fileName, reader.LineNumber); foreach (Match match in rxMarkdownLink.Matches(reader.Current)) { if (!match.Success) { continue; // Can this happen? } var caption = match.Groups[1].Value; var path = match.Groups[2].Value; yield return(new Link(caption, path, location)); } } }
public XmlBlock(string originalText, ConfigurationLocation location) { OriginalText = originalText; Location = location; }
/// <summary> /// This attribute is used to specify where a command should get their settings from. /// </summary> /// <param name="configType">The configuration type.</param> /// <param name="configLocation">The configuration location.</param> public XimuraAppConfigurationAttribute(ConfigurationLocation configType, string configLocation) { mConfigType = configType; mConfigLocation = configLocation; }
public Link(string caption, string path, ConfigurationLocation location) { Caption = caption; Path = new NormalisedPath(path); Location = location; }