Skip to content

Commit

Permalink
IncludeInUpdate should use ContentProbability
Browse files Browse the repository at this point in the history
  • Loading branch information
Mpdreamz committed Dec 10, 2024
1 parent d98b621 commit aa9b9ee
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
10 changes: 6 additions & 4 deletions actions/publish/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,20 @@ runs:
- id: repo-basename
shell: bash
run: 'echo "value=`basename ${{ github.repository }}`" >> $GITHUB_OUTPUT'
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5.0.0
- name: Build documentation
uses: elastic/docs-builder@main
with:
prefix: '${{ steps.repo-basename.outputs.value }}'
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5.0.0
- name: List Documentation
shell: bash
run: 'ls .artifacts/docs/html'
- name: Upload artifact
uses: actions/upload-pages-artifact@v3.0.1
with:
path: .artifacts/docs/html

- name: Deploy artifact
id: deployment
uses: actions/deploy-pages@v4.0.5
Expand Down
2 changes: 1 addition & 1 deletion src/docs-generator/Cli/Commands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ private void WriteMarkdownFile(DirectoryInfo directoryInfo, MarkdownFile markdow
}
}

void LoadStateFromFile(FileInfo fileInfo, bool? clear, ref int? seedFs, ref bool cleanOutput)
private void LoadStateFromFile(FileInfo fileInfo, bool? clear, ref int? seedFs, ref bool cleanOutput)
{
if (!fileInfo.Exists) return;
var state = File.ReadAllText(fileInfo.FullName).Split("|");
Expand Down
4 changes: 2 additions & 2 deletions src/docs-generator/Domain/Determinism.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public Determinism(int? seedFileSystem, int? seedContent)
FileSystem = new Randomizer(SeedFileSystem);
Contents = new Randomizer(SeedContent);

SectionProbability = Contents.Float(0.001f, Contents.Float(0.1f));
ContentProbability = Contents.Float(0.001f, Contents.Float(0.1f));
FileProbability = FileSystem.Float(0.001f, Contents.Float(0.1f));
}

Expand All @@ -27,7 +27,7 @@ public Determinism(int? seedFileSystem, int? seedContent)
public Randomizer FileSystem { get; }
public Randomizer Contents { get; }

public float SectionProbability { get; }
public float ContentProbability { get; }
public float FileProbability { get; }

public static Determinism Random { get; set; } = new(null, null);
Expand Down
2 changes: 1 addition & 1 deletion src/docs-generator/Domain/Generators.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ static Generators()
.Ignore(p => p.Links)
.Ignore(p => p.Directory)
.RuleFor(p => p.FileName, f => f.System.FileName("md"))
.RuleFor(p => p.IncludeInUpdate, f => f.Random.Float() <= Determinism.Random.FileProbability)
.RuleFor(p => p.IncludeInUpdate, f => f.Random.Float() <= Determinism.Random.ContentProbability)
.RuleFor(p => p.Sections, f => Section.Generate(Determinism.Random.Contents.Number(1, 12)).ToArray());
}

Expand Down

0 comments on commit aa9b9ee

Please sign in to comment.