You've already forked linux-packaging-mono
acceptance-tests
data
debian
docs
external
Newtonsoft.Json
api-doc-tools
external
mdoc
monodoc
Assembly
Mono.Documentation
Mono.Utilities
Monodoc
caches
generators
html
HtmlGenerator.cs
RawGenerator.cs
providers
storage
HelpSource.cs
HelpSource_Legacy.cs
Node.cs
Node_Legacy.cs
Provider.cs
RootTree.cs
RootTree_Legacy.cs
SearchableDocument.cs
SearchableIndex.cs
Tree.cs
TypeUtils.cs
cache.cs
generator.cs
index.cs
settings.cs
settings_Legacy.cs
storage.cs
Monodoc.Ecma
Properties
Resources
Test
Makefile
jay.sh
monodoc.csproj
monodoc.dll.config
.gitignore
.gitmodules
Makefile
README.md
apidoctools.sln
api-snapshot
aspnetwebstack
binary-reference-assemblies
bockbuild
boringssl
cecil
cecil-legacy
corefx
corert
ikdasm
ikvm
linker
nuget-buildtasks
nunit-lite
roslyn-binaries
rx
xunit-binaries
ikvm-native
libgc
llvm
m4
man
mcs
mk
mono
msvc
po
runtime
samples
scripts
support
tools
COPYING.LIB
LICENSE
Makefile.am
Makefile.in
NEWS
README.md
acinclude.m4
aclocal.m4
autogen.sh
code_of_conduct.md
compile
config.guess
config.h.in
config.rpath
config.sub
configure.REMOVED.git-id
configure.ac.REMOVED.git-id
depcomp
install-sh
ltmain.sh.REMOVED.git-id
missing
mkinstalldirs
mono-uninstalled.pc.in
test-driver
winconfig.h
42 lines
1.1 KiB
C#
42 lines
1.1 KiB
C#
![]() |
using System;
|
||
|
using System.IO;
|
||
|
using System.Text;
|
||
|
using System.Linq;
|
||
|
using System.Collections.Generic;
|
||
|
|
||
|
using Monodoc;
|
||
|
|
||
|
namespace Monodoc.Generators
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// This generators returns the raw content of the HelpSource without any transformation
|
||
|
/// </summary>
|
||
|
public class RawGenerator : IDocGenerator<string>
|
||
|
{
|
||
|
public string Generate (HelpSource hs, string id, Dictionary<string, string> context)
|
||
|
{
|
||
|
if (hs == null || string.IsNullOrEmpty (id))
|
||
|
return null;
|
||
|
|
||
|
IEnumerable<string> parts;
|
||
|
if (hs.IsMultiPart (id, out parts))
|
||
|
return GenerateMultiPart (hs, parts, id, context);
|
||
|
|
||
|
if (hs.IsRawContent (id))
|
||
|
return hs.GetText (id) ?? string.Empty;
|
||
|
|
||
|
var result = hs.IsGeneratedContent (id) ? hs.GetCachedText (id) : new StreamReader (hs.GetCachedHelpStream (id)).ReadToEnd ();
|
||
|
|
||
|
return result;
|
||
|
}
|
||
|
|
||
|
string GenerateMultiPart (HelpSource hs, IEnumerable<string> ids, string originalId, Dictionary<string, string> context)
|
||
|
{
|
||
|
var sb = new StringBuilder ();
|
||
|
foreach (var id in ids)
|
||
|
sb.AppendLine (Generate (hs, id, context));
|
||
|
return sb.ToString ();
|
||
|
}
|
||
|
}
|
||
|
}
|