Skip to content

Commit

Permalink
BREAKING CHANGE: drop keepFileLink
Browse files Browse the repository at this point in the history
  • Loading branch information
yufeih committed Nov 11, 2023
1 parent 11e0600 commit 6bb73b1
Show file tree
Hide file tree
Showing 9 changed files with 1 addition and 42 deletions.
4 changes: 0 additions & 4 deletions docs/reference/docfx-json-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,6 @@ Sets the max parallelism. Setting 0 (default) is the same as setting to the coun

Sets the parameters for the markdown engine, value is a JSON object.

### `keepFileLink`

If set to true, docfx does not dereference (i.e., copy) the file to the output folder, instead, it saves a `link_to_path` property inside `manifest.json` to indicate the physical location of that file. A file link will be created by incremental build and copy resource file.

### `sitemap`

Specifies the options for generating [sitemap.xml](https://www.sitemaps.org/protocol.html) file:
Expand Down
1 change: 0 additions & 1 deletion samples/extensions/docfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"modern"
],
"postProcessors": [],
"keepFileLink": false,
"disableGitFeatures": false,
"exportViewModel": true
}
Expand Down
8 changes: 0 additions & 8 deletions src/Docfx.App/Config/BuildJsonConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -218,14 +218,6 @@ internal class BuildJsonConfig
[JsonPropertyName("groups")]
public Dictionary<string, GroupConfig> Groups { get; set; }

/// <summary>
/// If set to true, docfx does not dereference (aka. copy) file to the output folder.
/// Instead, it saves a link_to_path property inside manifest.json to indicate the physical location of that file.
/// </summary>
[JsonProperty("keepFileLink")]
[JsonPropertyName("keepFileLink")]
public bool KeepFileLink { get; set; }

/// <summary>
/// Specifies the options for the sitemap.xml file.
/// </summary>
Expand Down
5 changes: 0 additions & 5 deletions src/Docfx.App/Helpers/DocumentBuilderWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,6 @@ private static List<DocumentBuildParameters> ConfigToParameter(BuildJsonConfig c

var fileMappingParametersDictionary = GroupFileMappings(config.Content, config.Overwrite, config.Resource);

if (config.KeepFileLink)
{
parameters.KeepFileLink = true;
}

foreach (var pair in fileMappingParametersDictionary)
{
var p = parameters.Clone();
Expand Down
2 changes: 0 additions & 2 deletions src/Docfx.Build/DocumentBuildParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ public class DocumentBuildParameters

public string CustomLinkResolver { get; set; }

public bool KeepFileLink { get; set; }

public SitemapOptions SitemapOptions { get; set; }

public bool DisableGitFeatures { get; set; }
Expand Down
17 changes: 1 addition & 16 deletions src/Docfx.Build/DocumentBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,22 +149,7 @@ public void Build(IList<DocumentBuildParameters> parameters, string outputDirect

_postProcessorsManager.Process(generatedManifest, outputDirectory);

if (parameters[0].KeepFileLink)
{
var count = (from f in generatedManifest.Files
from o in f.Output
select o.Value into v
where v.LinkToPath != null
select v).Count();
if (count > 0)
{
Logger.LogInfo($"Skip dereferencing {count} files.");
}
}
else
{
generatedManifest.Dereference(parameters[0].OutputBaseDir, parameters[0].MaxParallelism);
}
generatedManifest.Dereference(parameters[0].OutputBaseDir, parameters[0].MaxParallelism);

// Save to manifest.json
EnvironmentContext.FileAbstractLayerImpl =
Expand Down
1 change: 0 additions & 1 deletion src/docfx/Models/BuildCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ internal static void MergeOptionsToConfig(BuildCommandOptions options, BuildJson

SetGlobalMetadataFromCommandLineArgs();

config.KeepFileLink |= options.KeepFileLink;
config.DisableGitFeatures |= options.DisableGitFeatures;

void SetGlobalMetadataFromCommandLineArgs()
Expand Down
4 changes: 0 additions & 4 deletions src/docfx/Models/BuildCommandOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,6 @@ internal class BuildCommandOptions : LogOptions
[TypeConverter(typeof(ArrayOptionConverter))]
public IEnumerable<string> PostProcessors { get; set; }

[Description("If set to true, docfx does not dereference (aka. copy) file to the output folder, instead, it saves a link_to_path property inside manifest.json to indicate the physical location of that file.")]
[CommandOption("--keepFileLink")]
public bool KeepFileLink { get; set; }

[Description("Disable fetching Git related information for articles. By default it is enabled and may have side effect on performance when the repo is large.")]
[CommandOption("--disableGitFeatures")]
public bool DisableGitFeatures { get; set; }
Expand Down
1 change: 0 additions & 1 deletion test/docfx.Tests/JsonConverterTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public void TestJObjectDictionaryToObjectDictionaryConverterSerializeAndDeserial
"}" +
"}" +
"}," +
"\"keepFileLink\":false," +
"\"disableGitFeatures\":false" +
"}";

Expand Down

0 comments on commit 6bb73b1

Please sign in to comment.