Skip to content

Commit

Permalink
fix edit links.. update Wix docs directory (#1444)
Browse files Browse the repository at this point in the history
* fix edit links.. update Wix docs directory

* Updates and additions

---------

Co-authored-by: Dennis Reimann <[email protected]>
  • Loading branch information
TChukwuleta and dennisreimann authored Nov 11, 2024
1 parent be134c6 commit 613a0db
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 49 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
/docs/Transmuter
/docs/Trocador
/docs/Wabisabi
/docs/Wix*
/docs/Wix
/docs/Odoo
/docs/Vault
/docs/Xenforo
Expand All @@ -37,7 +37,6 @@
/docs/img/btcpayexposecloudflare*
/docs/img/cloudflare*
/docs/img/Cloudflare*
/docs/img/wix*
/swagger/plugins/btcpay.json

# Constructed docs
Expand Down
2 changes: 1 addition & 1 deletion docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ const sidebarUserGuide = [
['/Xenforo/', 'Xenforo'],
['/InvoiceNinja', 'Invoice Ninja'],
['/Odoo/', 'Odoo'],
['/Wix', 'Wix'],
['/Wix/', 'Wix'],
['/CustomIntegration', 'Custom Integration']
]
},
Expand Down
26 changes: 17 additions & 9 deletions docs/.vuepress/preprocessMarkdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,32 @@ const isDev = process.env.NODE_ENV === 'development'

// external docs: local dir as key, repo base as value
const EXTERNAL_DOCS = {
BigCommerce: 'https://github.com/TChukwuleta/BTCPayServerPlugins/tree/main/Plugins/BTCPayServer.Plugins.BigCommercePlugin',
Breez: 'https://github.com/Kukks/BTCPayServerPlugins/tree/master/Plugins/BTCPayServer.Plugins.Breez',
Bringin: 'https://github.com/Kukks/BTCPayServerPlugins/tree/master/Plugins/BTCPayServer.Plugins.Bringin',
BTCPayServer: 'https://github.com/btcpayserver/btcpayserver',
NBXplorer: 'https://github.com/dgarage/NBXplorer',
Configurator: 'https://github.com/btcpayserver/btcpayserver-configurator',
Docker: 'https://github.com/btcpayserver/btcpayserver-docker',
Vault: 'https://github.com/btcpayserver/BTCPayServer.Vault',
Transmuter: 'https://github.com/btcpayserver/btcTransmuter',
Zapier: 'https://github.com/btcpayserver/zapier',
Drupal: 'https://github.com/btcpayserver/commerce_btcpay',
DynamicReports: 'https://github.com/Kukks/BTCPayServerPlugins/tree/master/Plugins/BTCPayServer.Plugins.DynamicReports',
Grandnode: 'https://github.com/btcpayserver/grandnode',
LNDhubAPI: 'https://github.com/dennisreimann/btcpayserver-plugin-lndhub-api',
NBXplorer: 'https://github.com/dgarage/NBXplorer',
Nopcommerce: 'https://github.com/btcpayserver/nopcommerce',
Nostr: 'https://github.com/Kukks/BTCPayServerPlugins/tree/master/Plugins/BTCPayServer.Plugins.NIP05',
Odoo: 'https://github.com/btcpayserver/odoo',
Payroll: 'https://github.com/rockstardev/BTCPayServerPlugins.RockstarDev/tree/master/Plugins/BTCPayServer.RockstarDev.Plugins.Payroll',
PodServer: 'https://github.com/dennisreimann/btcpayserver-plugin-podserver',
SideShift: 'https://github.com/Kukks/BTCPayServerPlugins/tree/master/Plugins/BTCPayServer.Plugins.SideShift',
Smartstore: 'https://github.com/btcpayserver/Smartstore.BTCPayServer',
TicketTailor: 'https://github.com/Kukks/BTCPayServerPlugins/tree/master/Plugins/BTCPayServer.Plugins.TicketTailor',
Transmuter: 'https://github.com/btcpayserver/btcTransmuter',
Trocador: 'https://github.com/saltrafael/trocador-plugin',
Vault: 'https://github.com/btcpayserver/BTCPayServer.Vault',
Wix: 'https://github.com/btcpayserver/wix',
Wabisabi: 'https://github.com/Kukks/BTCPayServerPlugins/tree/master/Plugins/BTCPayServer.Plugins.Wabisabi',
Smartstore: 'https://github.com/btcpayserver/Smartstore.BTCPayServer.git',
Grandnode: 'https://github.com/btcpayserver/grandnode.git',
Nopcommerce: 'https://github.com/btcpayserver/nopcommerce.git',
Xenforo: 'https://github.com/btcpayserver/xenforo.git',
Odoo: 'https://github.com/btcpayserver/odoo.git'
Xenforo: 'https://github.com/btcpayserver/xenforo',
Zapier: 'https://github.com/btcpayserver/zapier'
}

const replaceExternalRepoLinks = (source, externalRepoUrl, resourcePath) => {
Expand Down
75 changes: 38 additions & 37 deletions setup-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ WIX_DIR="$BASE_DIR/deps/wix"
update_external() {
file="$1"
repo="$2"
base="$3"
edit="$3"
base="$4"
path="${file#${base}}"
[[ $path = "Security.md" ]] && path="SECURITY.md"
[[ $path = "README.md" || $path = "SECURITY.md" ]] && folder="" || folder="docs/"
[[ $path = "README.md" || $path = "readme.md" || $path = "SECURITY.md" ]] && folder="" || folder="docs/"
content=$(cat "$file")
# add frontmatter to omit edit links for external docs
echo $'---\neditLink: '"$repo/edit/master/$folder$path"$'\nexternalRepo: '"$repo"$'\n---\n'"$content" > "$file"
echo $'---\nexternalRepo: '"$repo"$'\neditLink: '"$edit/$folder$path"$'\n---\n'"$content" > "$file"
}

# BTCPay Server
Expand All @@ -61,7 +62,7 @@ line=$(grep -n '## How to manually test payments' $DOCS_DIR/BTCPayServer/LocalDe
{ echo $'---\neditLink: https://github.com/btcpayserver/btcpayserver-doc/edit/master/docs/Development/LocalDev.md\n---\n'; cat "$DOCS_DIR/Development/LocalDev.md"; echo; tail -n +$line "$DOCS_DIR/BTCPayServer/LocalDevSetup.md"; } > "$DOCS_DIR/Development/LocalDevelopment.md"

for file in "$DOCS_DIR"/BTCPayServer/*.md; do
update_external "$file" https://github.com/btcpayserver/btcpayserver "$DOCS_DIR"/BTCPayServer/
update_external "$file" https://github.com/btcpayserver/btcpayserver https://github.com/btcpayserver/btcpayserver/edit/master "$DOCS_DIR"/BTCPayServer/
done

# NBXplorer
Expand All @@ -82,7 +83,7 @@ cd "$NBXPLORER_DIR"
cp -r README.md docs/* "$DOCS_DIR/NBXplorer"
sed -ie 's$(./docs/$(./$g' "$DOCS_DIR/NBXplorer/README.md"
for file in "$DOCS_DIR"/NBXplorer/*.md; do
update_external "$file" https://github.com/dgarage/NBXplorer "$DOCS_DIR"/NBXplorer/
update_external "$file" https://github.com/dgarage/NBXplorer https://github.com/dgarage/NBXplorer/edit/master "$DOCS_DIR"/NBXplorer/
done

# Vault
Expand All @@ -102,7 +103,7 @@ cd "$VAULT_DIR"
cp -r README.md docs/* "$DOCS_DIR/Vault"
sed -ie 's$(docs/$(./$g' "$DOCS_DIR/Vault/README.md"
for file in "$DOCS_DIR"/Vault/*.md; do
update_external "$file" https://github.com/btcpayserver/BTCPayServer.Vault "$DOCS_DIR"/Vault/
update_external "$file" https://github.com/btcpayserver/BTCPayServer.Vault https://github.com/btcpayserver/BTCPayServer.Vault/edit/master "$DOCS_DIR"/Vault/
done

# Configurator
Expand All @@ -122,7 +123,7 @@ cd "$CONFIGURATOR_DIR"
cp -r README.md docs/* "$DOCS_DIR/Configurator"
sed -ie 's$(./docs/$(./$g' "$DOCS_DIR/Configurator/README.md"
for file in "$DOCS_DIR"/Configurator/*.md; do
update_external "$file" https://github.com/btcpayserver/btcpayserver-configurator "$DOCS_DIR"/Configurator/
update_external "$file" https://github.com/btcpayserver/btcpayserver-configurator https://github.com/btcpayserver/btcpayserver-configurator/edit/master "$DOCS_DIR"/Configurator/
done

# Docker
Expand All @@ -145,7 +146,7 @@ line=$(grep -n '# Introduction' README.md | cut -d ":" -f 1)
tail -n +$line "README.md" > "$DOCS_DIR/Docker/README.md"
sed -ie 's$(docs/$(./$g' "$DOCS_DIR/Docker/README.md"
for file in "$DOCS_DIR"/Docker/*.md; do
update_external "$file" https://github.com/btcpayserver/btcpayserver-docker "$DOCS_DIR"/Docker/
update_external "$file" https://github.com/btcpayserver/btcpayserver-docker https://github.com/btcpayserver/btcpayserver-docker/edit/master "$DOCS_DIR"/Docker/
done

cp contrib/FastSync/README.md "$DOCS_DIR/Docker/fastsync.md"
Expand All @@ -171,7 +172,7 @@ cd "$TRANSMUTER_DIR"
cp -r README.md docs/* "$DOCS_DIR/Transmuter"
sed -ie 's$(docs/$(./$g' "$DOCS_DIR/Transmuter/README.md"
for file in "$DOCS_DIR"/Transmuter/*.md; do
update_external "$file" https://github.com/btcpayserver/btcTransmuter "$DOCS_DIR"/Transmuter/
update_external "$file" https://github.com/btcpayserver/btcTransmuter https://github.com/btcpayserver/btcTransmuter/edit/master "$DOCS_DIR"/Transmuter/
done

# Zapier
Expand All @@ -191,7 +192,7 @@ cd "$ZAPIER_DIR"
cp -r README.md doc/* "$DOCS_DIR/Zapier"
sed -ie 's$(./doc/$(./$g' "$DOCS_DIR/Zapier/README.md"
for file in "$DOCS_DIR"/Zapier/*.md; do
update_external "$file" https://github.com/btcpayserver/zapier "$DOCS_DIR"/Zapier/
update_external "$file" https://github.com/btcpayserver/zapier https://github.com/btcpayserver/zapier/edit/master "$DOCS_DIR"/Zapier/
done

# PodServer
Expand All @@ -210,7 +211,7 @@ cd "$PODSERVER_DIR"
cp -r README.md docs/* "$DOCS_DIR/PodServer"
sed -ie 's$(./docs/$(./$g' "$DOCS_DIR/PodServer/README.md"
for file in "$DOCS_DIR"/PodServer/*.md; do
update_external "$file" https://github.com/dennisreimann/btcpayserver-plugin-podserver "$DOCS_DIR"/PodServer/
update_external "$file" https://github.com/dennisreimann/btcpayserver-plugin-podserver https://github.com/dennisreimann/btcpayserver-plugin-podserver/edit/master "$DOCS_DIR"/PodServer/
done

# LNDhub API
Expand All @@ -229,7 +230,7 @@ cd "$LNDHUBAPI_DIR"
cp -r README.md docs/* "$DOCS_DIR/LNDhubAPI"
sed -ie 's$(./docs/$(./$g' "$DOCS_DIR/LNDhubAPI/README.md"
for file in "$DOCS_DIR"/LNDhubAPI/*.md; do
update_external "$file" https://github.com/dennisreimann/btcpayserver-plugin-lndhub-api "$DOCS_DIR"/LNDhubAPI/
update_external "$file" https://github.com/dennisreimann/btcpayserver-plugin-lndhub-api https://github.com/dennisreimann/btcpayserver-plugin-lndhub-api/edit/master "$DOCS_DIR"/LNDhubAPI/
done

# Trocador
Expand All @@ -248,7 +249,7 @@ fi
cd "$TROCADOR_DIR"
cp -r README.md "$DOCS_DIR/Trocador"
for file in "$DOCS_DIR"/Trocador/*.md; do
update_external "$file" https://github.com/saltrafael/trocador-plugin "$DOCS_DIR"/Trocador/
update_external "$file" https://github.com/saltrafael/trocador-plugin https://github.com/saltrafael/trocador-plugin/edit/master "$DOCS_DIR"/Trocador/
done

# Drupal
Expand All @@ -267,7 +268,7 @@ fi
cd "$DRUPAL_DIR"
cp -r README.md "$DOCS_DIR/Drupal"
for file in "$DOCS_DIR"/Drupal/*.md; do
update_external "$file" https://github.com/btcpayserver/commerce_btcpay.git "$DOCS_DIR"/Drupal/
update_external "$file" https://github.com/btcpayserver/commerce_btcpay https://github.com/btcpayserver/commerce_btcpay/edit/8.x-1.x "$DOCS_DIR"/Drupal/
done

# Smartstore
Expand All @@ -286,7 +287,7 @@ fi
cd "$SMARTSTORE_DIR"
cp -r src/Smartstore.Modules/Smartstore.BTCPayServer/README.md "$DOCS_DIR/Smartstore"
for file in "$DOCS_DIR"/Smartstore/*.md; do
update_external "$file" https://github.com/btcpayserver/Smartstore.BTCPayServer.git "$DOCS_DIR"/Smartstore/
update_external "$file" https://github.com/btcpayserver/Smartstore.BTCPayServer https://github.com/btcpayserver/Smartstore.BTCPayServer/edit/main "$DOCS_DIR"/Smartstore/
done

# Grandnode
Expand All @@ -305,7 +306,7 @@ fi
cd "$GRANDNODE_DIR"
cp -r README.md "$DOCS_DIR/Grandnode"
for file in "$DOCS_DIR"/Grandnode/*.md; do
update_external "$file" https://github.com/btcpayserver/grandnode.git "$DOCS_DIR"/Grandnode/
update_external "$file" https://github.com/btcpayserver/grandnode https://github.com/btcpayserver/grandnode/edit/main "$DOCS_DIR"/Grandnode/
done

# Nopcommerce
Expand All @@ -324,14 +325,17 @@ fi
cd "$NOPCOMMERCE_DIR"
cp -r README.md "$DOCS_DIR/Nopcommerce"
for file in "$DOCS_DIR"/Nopcommerce/*.md; do
update_external "$file" https://github.com/btcpayserver/nopcommercee.git "$DOCS_DIR"/Nopcommerce/
update_external "$file" https://github.com/btcpayserver/nopcommerce https://github.com/btcpayserver/nopcommerce/edit/main "$DOCS_DIR"/Nopcommerce/
done

# Wix
echo "Setup dependency: Wix"

rm -rf "$DOCS_DIR/img/wix"
mkdir -p "$DOCS_DIR/img/wix"
rm -rf "$DOCS_DIR/Wix"
mkdir -p "$DOCS_DIR/Wix"

rm -rf "$DOCS_DIR/Wix"
mkdir -p "$DOCS_DIR/Wix"

if [ ! -d "$WIX_DIR" ]; then
git clone --depth 1 https://github.com/btcpayserver/wix.git "$WIX_DIR"
Expand All @@ -340,10 +344,10 @@ else
fi

cd "$WIX_DIR"
cp -r README.md "$DOCS_DIR/Wix.md"
cp -r img/wix/* "$DOCS_DIR/img/wix"
update_external "$DOCS_DIR/Wix.md" https://github.com/btcpayserver/wix.git "$DOCS_DIR"

cp -r README.md img "$DOCS_DIR/Wix"
for file in "$DOCS_DIR"/Wix/*.md; do
update_external "$file" https://github.com/btcpayserver/wix https://github.com/btcpayserver/wix/edit/main "$DOCS_DIR"/Wix/
done

# Xenforo

Expand All @@ -361,7 +365,7 @@ fi
cd "$XENFORO_DIR"
cp -r README.md "$DOCS_DIR/Xenforo"
for file in "$DOCS_DIR"/Xenforo/*.md; do
update_external "$file" https://github.com/btcpayserver/xenforo.git "$DOCS_DIR"/Xenforo/
update_external "$file" https://github.com/btcpayserver/xenforo https://github.com/btcpayserver/xenforo/edit/main "$DOCS_DIR"/Xenforo/
done

# Odoo
Expand All @@ -380,10 +384,9 @@ fi
cd "$ODOO_DIR"
cp -r payment_btcpayserver/README.md "$DOCS_DIR/Odoo"
for file in "$DOCS_DIR"/Odoo/*.md; do
update_external "$file" https://github.com/btcpayserver/odoo.git "$DOCS_DIR"/Odoo/
update_external "$file" https://github.com/btcpayserver/odoo https://github.com/btcpayserver/odoo/edit/17.0 "$DOCS_DIR"/Odoo/
done


# Kukks' plugins

echo "Setup dependency: Kukks' plugins"
Expand All @@ -402,51 +405,51 @@ cd "$KUKKS_DIR/Plugins/BTCPayServer.Plugins.Wabisabi"
cp -r readme.md docs/* "$DOCS_DIR/Wabisabi"
sed -ie 's$docs/$./$g' "$DOCS_DIR/Wabisabi/readme.md"
for file in "$DOCS_DIR"/Wabisabi/*.md; do
update_external "$file" https://github.com/Kukks/BTCPayServerPlugins/tree/master/Plugins/BTCPayServer.Plugins.Wabisabi "$DOCS_DIR"/Wabisabi/
update_external "$file" https://github.com/Kukks/BTCPayServerPlugins/tree/master/Plugins/BTCPayServer.Plugins.Wabisabi https://github.com/Kukks/BTCPayServerPlugins/edit/master/Plugins/BTCPayServer.Plugins.Wabisabi "$DOCS_DIR"/Wabisabi/
done

cd "$KUKKS_DIR/Plugins/BTCPayServer.Plugins.TicketTailor"

cp -r README.md "$DOCS_DIR/TicketTailor"
for file in "$DOCS_DIR"/TicketTailor/*.md; do
update_external "$file" https://github.com/Kukks/BTCPayServerPlugins/tree/master/Plugins/BTCPayServer.Plugins.TicketTailor "$DOCS_DIR"/TicketTailor/
update_external "$file" https://github.com/Kukks/BTCPayServerPlugins/tree/master/Plugins/BTCPayServer.Plugins.TicketTailor https://github.com/Kukks/BTCPayServerPlugins/edit/master/Plugins/BTCPayServer.Plugins.TicketTailor "$DOCS_DIR"/TicketTailor/
done

cd "$KUKKS_DIR/Plugins/BTCPayServer.Plugins.NIP05"

cp -r readme.md "$DOCS_DIR/Nostr"
for file in "$DOCS_DIR"/Nostr/*.md; do
update_external "$file" https://github.com/Kukks/BTCPayServerPlugins/tree/master/Plugins/BTCPayServer.Plugins.NIP05 "$DOCS_DIR"/Nostr/
update_external "$file" https://github.com/Kukks/BTCPayServerPlugins/tree/master/Plugins/BTCPayServer.Plugins.NIP05 https://github.com/Kukks/BTCPayServerPlugins/edit/master/Plugins/BTCPayServer.Plugins.NIP05 "$DOCS_DIR"/Nostr/
done

cd "$KUKKS_DIR/Plugins/BTCPayServer.Plugins.SideShift"

cp -r README.md "$DOCS_DIR/SideShift"
for file in "$DOCS_DIR"/SideShift/*.md; do
sed -i 's/[^[:print:]\t]//g' "$file"
update_external "$file" https://github.com/Kukks/BTCPayServerPlugins/tree/master/Plugins/BTCPayServer.Plugins.SideShift "$DOCS_DIR"/SideShift/
update_external "$file" https://github.com/Kukks/BTCPayServerPlugins/tree/master/Plugins/BTCPayServer.Plugins.SideShift https://github.com/Kukks/BTCPayServerPlugins/edit/master/Plugins/BTCPayServer.Plugins.SideShift "$DOCS_DIR"/SideShift/
done

cd "$KUKKS_DIR/Plugins/BTCPayServer.Plugins.Breez"

cp -r README.md "$DOCS_DIR/Breez"
for file in "$DOCS_DIR"/Breez/*.md; do
update_external "$file" https://github.com/Kukks/BTCPayServerPlugins/tree/master/Plugins/BTCPayServer.Plugins.Breez "$DOCS_DIR"/Breez/
update_external "$file" https://github.com/Kukks/BTCPayServerPlugins/tree/master/Plugins/BTCPayServer.Plugins.Breez https://github.com/Kukks/BTCPayServerPlugins/edit/master/Plugins/BTCPayServer.Plugins.Breez "$DOCS_DIR"/Breez/
done

cd "$KUKKS_DIR/Plugins/BTCPayServer.Plugins.Bringin"

cp -r README.md "$DOCS_DIR/Bringin"
for file in "$DOCS_DIR"/Bringin/*.md; do
update_external "$file" https://github.com/Kukks/BTCPayServerPlugins/tree/master/Plugins/BTCPayServer.Plugins.Bringin "$DOCS_DIR"/Bringin/
update_external "$file" https://github.com/Kukks/BTCPayServerPlugins/tree/master/Plugins/BTCPayServer.Plugins.Bringin https://github.com/Kukks/BTCPayServerPlugins/edit/master/Plugins/BTCPayServer.Plugins.Bringin "$DOCS_DIR"/Bringin/
done

cd "$KUKKS_DIR/Plugins/BTCPayServer.Plugins.DynamicReports"

cp -r README.md "$DOCS_DIR/DynamicReports"
for file in "$DOCS_DIR"/DynamicReports/*.md; do
sed -i 's/[^[:print:]\t]//g' "$file"
update_external "$file" https://github.com/Kukks/BTCPayServerPlugins/tree/master/Plugins/BTCPayServer.Plugins.DynamicReports "$DOCS_DIR"/DynamicReports/
update_external "$file" https://github.com/Kukks/BTCPayServerPlugins/tree/master/Plugins/BTCPayServer.Plugins.DynamicReports https://github.com/Kukks/BTCPayServerPlugins/edit/master/Plugins/BTCPayServer.Plugins.DynamicReports "$DOCS_DIR"/DynamicReports/
done


Expand All @@ -468,7 +471,7 @@ cd "$ROCKSTAR_DIR/Plugins/BTCPayServer.RockstarDev.Plugins.Payroll"
cp -r README.md "$DOCS_DIR/Payroll"
for file in "$DOCS_DIR"/Payroll/*.md; do
sed -i 's/[^[:print:]\t]//g' "$file"
update_external "$file" https://github.com/rockstardev/BTCPayServerPlugins.RockstarDev/tree/master/Plugins/BTCPayServer.RockstarDev.Plugins.Payroll "$DOCS_DIR"/Payroll/
update_external "$file" https://github.com/rockstardev/BTCPayServerPlugins.RockstarDev/tree/master/Plugins/BTCPayServer.RockstarDev.Plugins.Payroll https://github.com/rockstardev/BTCPayServerPlugins.RockstarDev/edit/master/Plugins/BTCPayServer.RockstarDev.Plugins.Payroll "$DOCS_DIR"/Payroll/
done

# Tobe' plugins
Expand All @@ -488,11 +491,9 @@ cd "$TOBSES_DIR/Plugins/BTCPayServer.Plugins.BigCommercePlugin"

cp -r README.md "$DOCS_DIR/BigCommerce"
for file in "$DOCS_DIR"/BigCommerce/*.md; do
update_external "$file" https://github.com/TChukwuleta/BTCPayServerPlugins/tree/main/Plugins/BTCPayServer.Plugins.BigCommercePlugin "$DOCS_DIR"/BigCommerce/
update_external "$file" https://github.com/TChukwuleta/BTCPayServerPlugins/tree/main/Plugins/BTCPayServer.Plugins.BigCommercePlugin https://github.com/TChukwuleta/BTCPayServerPlugins/edit/main/Plugins/BTCPayServer.Plugins.BigCommercePlugin "$DOCS_DIR"/BigCommerce/
done



# Swagger

# BTCPay Swagger: Checkout latest release tag, so that we do not publish docs for unreleased APIs yet
Expand Down

0 comments on commit 613a0db

Please sign in to comment.