Skip to content
This repository was archived by the owner on Dec 18, 2022. It is now read-only.

Commit 5cc0e3c

Browse files
authored
Merge pull request #78 from 05nelsonm/mn/update/dokka
Fix Dokka Docs
2 parents 88469d7 + a3b85f3 commit 5cc0e3c

File tree

6 files changed

+35
-8
lines changed

6 files changed

+35
-8
lines changed

.versions

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Version 1.0.0-alpha02 (2020-08-03)
44
- API breaking changes were made to `TorServiceController.Builder`. See the following to update:
55
- [TorServiceController.Builder](./topl-service/io.matthewnelson.topl_service/-tor-service-controller/-builder/index.md)
6-
- [TorServiceEventBroadcaster](./topl-service/io.matthewnelson.topl_service.service.components.onionproxy/-tor-service-event-broadcaster/index.md)
6+
- [TorServiceEventBroadcaster](./topl-service/io.matthewnelson.topl_service.service.components.onionproxy.model/-tor-service-event-broadcaster/index.md)
77
- Added ability to hide the notification
88
- NOTE: Will be shown when user swipes the application out of recent's tray (required).
99
- Service now starts via `Context.startService` + `Context.bindService` instead of starting

docs/get_started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Get Started
3131
no unnecessary classes or resources; just the binaries. Android API 29+ no longer supports
3232
execution of executable files from your application's `/data/data/` directory, and must now be
3333
installed in the `context.applicationInfo.nativeLibraryDir` directory (aka, `/data/app/...`)
34-
to execute.
34+
to execute.
3535
- Nothing more is needed in terms of configuring initialization via the
3636
`TorServiceController.Builder`, as files will be installed in the correct directory, and
3737
named to match what `topl-service` looks for.

docs/roadmap.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
:material-checkbox-marked: Alpha release
88
:material-checkbox-blank-outline: Pass-through commands to the TorControlConnection
99
:material-checkbox-blank-outline: Settings/Debug Activity (so devs don't have to create one if they don't wish to)
10-
:material-checkbox-blank-outline: Builder Option to disable stop service on task termination
10+
:material-checkbox-marked: Builder Option to disable stop service on task termination
1111
:material-checkbox-blank-outline: Transport Plugin support
1212
:material-checkbox-blank-outline: v3 Hidden Service Authentication support
1313
:material-checkbox-blank-outline: v3 Hidden Service Creation

sampleapp/src/main/java/io/matthewnelson/sampleapp/topl_android/CodeSamples.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ class CodeSamples {
139139
geoipAssetPath = "common/geoip",
140140
geoip6AssetPath = "common/geoip6"
141141
)
142+
.addTimeToDisableNetworkDelay(milliseconds = 1_000L)
142143
.addTimeToRestartTorDelay(milliseconds = 100L)
143144
.addTimeToStopServiceDelay(milliseconds = 100L)
144145
.disableStopServiceOnTaskRemoved(disable = false)

scripts/fix_dokka_doc_external_links.sh

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,35 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
7272
# Find all file paths within projectDir/docs/ that contains http:FIX_DOKKA_LINKDS/
7373
mapfile -t INPUT_FILES < <(grep -rnwl "$DIR/../docs/" -e "(http://FIX_DOKKA_LINKS/.*)")
7474

75-
# Replace the urls with appropriate file path for Mkdocs to generate proper urls
75+
# Replace the static string we're looking for with appropriate file path for Mkdocs to
76+
# generate proper links to files located in different modules.
7677
for INPUT_FILE in ${INPUT_FILES[*]}; do
77-
echo "Fixing line in $INPUT_FILE"
78-
sed -i 's+http://FIX_DOKKA_LINKS+../../..+gI' $INPUT_FILE
79-
done
78+
echo "Fixing line in: $INPUT_FILE"
79+
80+
# Det depth of the file location to determine number of directories needed to
81+
# traverse back to get to "../docs/<this directory>/"
82+
START_COUNTING=false
83+
FILE_DEPTH=-1
84+
IFS='/' read -ra DIRECTORY_ARRAY <<< "$INPUT_FILE"
85+
for DIRECTORY_NAME in "${DIRECTORY_ARRAY[@]}"; do
86+
if $START_COUNTING; then
87+
(( FILE_DEPTH++ ))
88+
fi
89+
90+
if [ "$DIRECTORY_NAME" == "docs" ]; then
91+
START_COUNTING=true
92+
fi
93+
94+
done
95+
96+
# Build string with number of directories needed to get back to the desired dir
97+
FILE_DEPTH_STRING=
98+
for (( i = 0; i < "$FILE_DEPTH"; i++ )); do
99+
FILE_DEPTH_STRING+="../"
100+
done
101+
102+
# Replace our static string with the proper directory location of the Dokka doc
103+
sed -i "s+http://FIX_DOKKA_LINKS+$FILE_DEPTH_STRING+gI" "$INPUT_FILE"
104+
done
105+
106+
exit 0

0 commit comments

Comments
 (0)