Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove 'Edit this page' button from autogenerated content pages #950

Merged
merged 2 commits into from
Feb 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions scripts/cip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import {
CIPDocsPath,
CIPStaticResourcePath,
CIPSourceRepo,
CIPRepoBaseUrl
CIPRepoBaseUrl,
customEditUrl
} from "./constants";

// Current pathname
Expand Down Expand Up @@ -120,7 +121,7 @@ const injectDocusaurusDocTags = (content: string) => {

// Add "---" with doc tags for Docusaurus
content =
"--- \nsidebar_label: " + "(" + cipNumber + ") " + title + content;
"--- \nsidebar_label: " + "(" + cipNumber + ") " + title + customEditUrl + content;

// Temporary solution!
// CIP script needs to be rebuild, currently CIP 49 has useless information in header that will be removed in the future
Expand Down
7 changes: 5 additions & 2 deletions scripts/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ const RLRepoBaseUrl: string = "https://github.com/Emurgo/cardano-serialization-l
const RLnamesRawBaseIndexUrl: string = "https://raw.githubusercontent.com/Emurgo/cardano-serialization-lib/master/doc/index.rst";
const RLRepoRawBaseUrl: string = "https://raw.githubusercontent.com/Emurgo/cardano-serialization-lib/master/doc/getting-started/";

//Token Registry contants
//Token Registry constants
const TRDocsPath: string = "./docs/native-tokens/token-registry";
const TRWiki: string = "https://github.com/cardano-foundation/cardano-token-registry/wiki";
const TRUrl: string = "https://github.com/cardano-foundation/cardano-token-registry/blob/master/";
const TRrepoRawWikiHomeUrl: string = "https://raw.githubusercontent.com/wiki/cardano-foundation/cardano-token-registry/";
const TROverviewUrl: string = "https://raw.githubusercontent.com/cardano-foundation/cardano-token-registry/master/README.md";

export {CIPReadmeUrl, CIPPReadmeRegex, CIPSourceRepo, CIPStaticResourcePath, CIPDocsPath, CIPRegex, CIPRepoBaseUrl, CIPRepoRawBaseUrl, RLStaticResourcePath, RLDocsPath, RLRepoBaseUrl, RLnamesRawBaseIndexUrl, RLRepoRawBaseUrl, TRDocsPath, TRWiki, TRUrl, TRrepoRawWikiHomeUrl, TROverviewUrl};
//General constants
const customEditUrl = "\ncustom_edit_url: null"

export {CIPReadmeUrl, CIPPReadmeRegex, CIPSourceRepo, CIPStaticResourcePath, CIPDocsPath, CIPRegex, CIPRepoBaseUrl, CIPRepoRawBaseUrl, RLStaticResourcePath, RLDocsPath, RLRepoBaseUrl, RLnamesRawBaseIndexUrl, RLRepoRawBaseUrl, TRDocsPath, TRWiki, TRUrl, TRrepoRawWikiHomeUrl, TROverviewUrl, customEditUrl};
4 changes: 3 additions & 1 deletion scripts/rust-library.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import {
RLDocsPath,
RLnamesRawBaseIndexUrl,
RLRepoBaseUrl,
RLStaticResourcePath
RLStaticResourcePath,
customEditUrl
} from "./constants";

// Current pathname
Expand Down Expand Up @@ -79,6 +80,7 @@ content = content.substring(0, 3) === "---" ? content.slice(3) : content;
content =
"--- \nsidebar_label: " +
sidebarLabel +
customEditUrl +
"\ntitle: " +
fileName +
"\n" +
Expand Down
4 changes: 3 additions & 1 deletion scripts/token-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import {
TRUrl,
TROverviewUrl,
TRrepoRawWikiHomeUrl,
TRWiki
TRWiki,
customEditUrl
} from "./constants";

// Current pathname
Expand Down Expand Up @@ -162,6 +163,7 @@ const injectDocusaurusDocTags = (content: string, fileName: string) => {
content =
"--- \nsidebar_label: " +
modifiedFileName +
customEditUrl +
"\ntitle: " +
fileName +
"\n" +
Expand Down