public HtmlElementInfo GenerateHyperlinkToReferences(ISymbol symbol, bool isLargeFile = false) { string symbolId = SymbolIdService.GetId(symbol); string referencesFilePath = Path.Combine(ProjectDestinationFolder, Constants.ReferencesFileName, symbolId + ".html"); string href = Paths.MakeRelativeToFile(referencesFilePath, documentDestinationFilePath); href = href.Replace('\\', '/'); var result = new HtmlElementInfo { Name = "a", Attributes = { ["id"] = symbolId, ["href"] = href, ["target"] = "n", }, DeclaredSymbol = symbol, DeclaredSymbolId = symbolId }; if (!isLargeFile) { var dataGlyph = string.Format("{0},{1}", SymbolIdService.GetGlyphNumber(symbol), GetSymbolDepth(symbol)); result.Attributes.Add("data-glyph", dataGlyph); } return(result); }
public DeclaredSymbolInfo(ISymbol symbol, string assemblyName = null) { ID = SymbolIdService.GetIdULong(symbol); Name = SymbolIdService.GetName(symbol); Kind = SymbolKindText.GetSymbolKind(symbol); Description = SymbolIdService.GetDisplayString(symbol); Glyph = SymbolIdService.GetGlyphNumber(symbol); AssemblyName = assemblyName; }
private void GenerateDeclarations() { Log.Write("Declarations..."); var lines = new List <string>(); if (DeclaredSymbols != null) { foreach (var declaredSymbol in DeclaredSymbols .OrderBy(s => SymbolIdService.GetName(s.Key)) .ThenBy(s => s.Value)) { lines.Add(string.Join(";", SymbolIdService.GetName(declaredSymbol.Key), // symbol name declaredSymbol.Value, // 8-byte symbol ID SymbolKindText.GetSymbolKind(declaredSymbol.Key), // kind (e.g. "class") Markup.EscapeSemicolons(SymbolIdService.GetDisplayString(declaredSymbol.Key)), // symbol full name and signature SymbolIdService.GetGlyphNumber(declaredSymbol.Key))); // icon number } } if (OtherFiles != null) { foreach (var document in OtherFiles.OrderBy(d => d)) { lines.Add(string.Join(";", Path.GetFileName(document), SymbolIdService.GetId(document), "file", Markup.EscapeSemicolons(document), Serialization.GetIconForExtension(document))); } } Serialization.WriteDeclaredSymbols(ProjectDestinationFolder, lines); }