-
-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CDN Preparation - further speed improvement - remove not needed seds …
…and basename calls
- Loading branch information
1 parent
7c6fbca
commit a2e336e
Showing
6 changed files
with
68 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,20 @@ | ||
#! /bin/sh | ||
#! /bin/bash | ||
# $1 is the top of the manual page tree to look through | ||
. ./bin/utils.sh | ||
|
||
dir=$1 | ||
cd $dir || exit | ||
|
||
for m in $(find . -name '*.md.tt' | sort); do | ||
description=$(grep '^OSSL-description:' $m | sed -e 's|^[^:]*: *||' -e 's|^ *"||' -e 's|" *||') | ||
# description=$(grep '^OSSL-description:' $m | sed -e 's|^[^:]*: *||' -e 's|^ *"||' -e 's|" *||') | ||
description=$(get_description $m) | ||
# If there isn't a description, it isn't a manpage and should not be | ||
# included | ||
if [ "$description" = "" ]; then | ||
continue | ||
fi | ||
manfile=$(echo $m | sed -e 's|\./||') | ||
manname=$(basename $manfile .md.tt) | ||
origmanfile=$(echo $manfile | sed -e "s|^$subdir|$origsubdir|") | ||
manfile=$(basename_custom $m) | ||
manname=$(basename_custom $manfile .md.tt) | ||
#origmanfile=$(echo $manfile | sed -e "s|^$subdir|$origsubdir|") | ||
echo "| [$manname]($manname.html) | $description |" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
# returns basename of filepath and removes extension if specified | ||
function basename_custom { | ||
if [[ -n $1 ]]; then | ||
filepath=$1 | ||
file_basename="${filepath##*/}" | ||
if [[ -n $2 ]]; then | ||
file_basename="${file_basename%.$2}" | ||
fi | ||
echo $file_basename | ||
else | ||
exit 1 | ||
fi | ||
} | ||
|
||
function dirname_custom { | ||
if [[ -n $1 ]]; then | ||
filepath=$1 | ||
echo ${filepath%/*} | ||
fi | ||
} | ||
|
||
function get_description { | ||
FILE="$1" | ||
TEXT='^OSSL-description:' | ||
i=0 | ||
while read line; do | ||
|
||
if [[ "$line" =~ ^OSSL-description: ]]; then | ||
line=${line#*'"'} | ||
line=${line%'"'*} | ||
echo "$line" | ||
break | ||
fi | ||
done <"$FILE" | ||
} | ||
|
||
# get_descriptiom ../docs/man3.2/man3/BIO_get_rpoll_descriptor.md.tt | ||
# basename_custom docs/manmaster/man3/CMS_SignedData_free.md.tt md.tt |