Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
jlangch committed Oct 18, 2023
1 parent ff46517 commit 7163e2b
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
import com.github.jlangch.venice.impl.docgen.cheatsheet.modules.ModuleSemverSection;
import com.github.jlangch.venice.impl.docgen.cheatsheet.modules.ModuleShellSection;
import com.github.jlangch.venice.impl.docgen.cheatsheet.modules.ModuleTestSection;
import com.github.jlangch.venice.impl.docgen.cheatsheet.modules.ModuleTimingSection;
import com.github.jlangch.venice.impl.docgen.cheatsheet.modules.ModuleTracingSection;
import com.github.jlangch.venice.impl.docgen.cheatsheet.modules.ModuleXmlSection;
import com.github.jlangch.venice.impl.docgen.cheatsheet.section.ArraySection;
Expand Down Expand Up @@ -322,6 +323,7 @@ private List<DocSection> getTOC() {
extmod.addSection(new DocSection("Test", "modules.test"));
extmod.addSection(new DocSection("Tracing", "modules.tracing"));
extmod.addSection(new DocSection("Benchmark", "modules.benchmark"));
extmod.addSection(new DocSection("Timing", "modules.timing"));
extmod.addSection(new DocSection("App", "modules.app"));
extmod.addSection(new DocSection("QR\u00A0Ref", "modules.qrref"));
content.add(extmod);
Expand Down Expand Up @@ -421,7 +423,8 @@ private List<DocSection> getModulesRightSections() {
new ModuleConfigSection(diBuilder).section(),
new ModuleComponentSection(diBuilder).section(),
new ModuleAppSection(diBuilder).section(),
new ModuleBenchmarkSection(diBuilder).section());
new ModuleBenchmarkSection(diBuilder).section(),
new ModuleTimingSection(diBuilder).section());
}

private List<DocItem> getDocItems(final List<DocSection> sections) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/* __ __ _
* \ \ / /__ _ __ (_) ___ ___
* \ \/ / _ \ '_ \| |/ __/ _ \
* \ / __/ | | | | (_| __/
* \/ \___|_| |_|_|\___\___|
*
*
* Copyright 2017-2023 Venice
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.github.jlangch.venice.impl.docgen.cheatsheet.modules;

import com.github.jlangch.venice.impl.docgen.cheatsheet.DocItemBuilder;
import com.github.jlangch.venice.impl.docgen.cheatsheet.DocSection;
import com.github.jlangch.venice.impl.docgen.cheatsheet.ISectionBuilder;


public class ModuleTimingSection implements ISectionBuilder {

public ModuleTimingSection(final DocItemBuilder diBuilder) {
this.diBuilder = diBuilder;
}

@Override
public DocSection section() {
final DocSection section = new DocSection(
"Timing",
"Timing",
"modules.timing");

final DocSection all = new DocSection("(load-module :timing)", id());
section.addSection(all);

final DocSection docker = new DocSection("Timing", id());
all.addSection(docker);
docker.addItem(diBuilder.getDocItem("timing/run", true));

return section;
}

private String id() {
return diBuilder.id();
}

private final DocItemBuilder diBuilder;
}

0 comments on commit 7163e2b

Please sign in to comment.