Skip to content
This repository was archived by the owner on Apr 20, 2023. It is now read-only.

Commit ee24d81

Browse files
author
kasper
committed
Add readme for tool and make script generic
1 parent b828418 commit ee24d81

File tree

4 files changed

+59
-42
lines changed

4 files changed

+59
-42
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Manpage update tool
2+
3+
Utility to update dotnet-cli documentation from https://github.com/dotnet/docs.
4+
5+
## Prerequisites
6+
7+
* Unix OS
8+
* `python` in PATH
9+
* `pandoc` installed
10+
* `pandocfilters` package installed
11+
* `unzip`
12+
* `wget` or `curl`
13+
14+
## Usage
15+
16+
```sh
17+
./update-man-pages.sh
18+
```
19+
20+
## Ubuntu example (from scratch)
21+
22+
```sh
23+
sudo apt install -y pandoc python python-pip wget unzip < /dev/null
24+
sudo pip install pandocfilters
25+
26+
git clone https://github.com/dotnet/cli
27+
./Documentation/manpage/tool/update-man-pages.sh
28+
```
File renamed without changes.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env sh
2+
#
3+
# Copyright (c) .NET Foundation and contributors. All rights reserved.
4+
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
5+
#
6+
7+
MANPAGE_TOOL_DIR=$(cd $(dirname $0); pwd)
8+
9+
cd $MANPAGE_TOOL_DIR/../sdk
10+
11+
echo "Downloading dotnet/docs master"
12+
13+
if [ -x "$(command -v curl)" ]; then
14+
curl -sSLO https://github.com/dotnet/docs/archive/master.zip > /dev/null
15+
elif [ -x "$(command -v wget)" ]; then
16+
wget -q https://github.com/dotnet/docs/archive/master.zip > /dev/null
17+
else
18+
echo "Please install curl or wget to proceed"
19+
exit 1
20+
fi
21+
22+
unzip -o master.zip > /dev/null
23+
rm master.zip*
24+
25+
ls docs-master/docs/core/tools/dotnet*.md | while read -r line;
26+
do
27+
echo "Working on $line"
28+
pandoc -s -t man -V section=1 -V header=".NET Core" --column=500 --filter $MANPAGE_TOOL_DIR/man-pandoc-filter.py "$line" -o "$(basename ${line%.md}.1)"
29+
done
30+
31+
rm -rf docs-master

Documentation/manpages/update-man-pages.sh

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)