Browse Source

fix typos

pull/16/head
bopol 2 years ago
parent
commit
688f709b78
  1. 17
      docs/00_Prepare_everything.md
  2. 8
      docs/01_Concept_of_the_extractor.md
  3. 14
      docs/02_Concept_of_LinkHandler.md
  4. 2
      docs/03_Implement_a_service.md
  5. 10
      docs/04_Run_changes_in_App.md
  6. 4
      docs/05_releasing.md
  7. 12
      docs/06_documentation.md
  8. 4
      docs/index.md

17
docs/00_Prepare_everything.md

@ -15,7 +15,7 @@ First and foremost, you need to meet the following conditions in order to write
### What You Need to Know:
- A basic understanding of __[git](https://try.github.io)__
- A basic understanding of __[Git](https://try.github.io)__
- Good __[Java](https://whatpixel.com/best-java-books/)__ knowledge
- A good understanding of __[web technology](https://www.w3schools.com/)__
- A basic understanding of __[unit testing](https://www.vogella.com/tutorials/JUnit/article.html)__ and __[JUnit](https://junit.org/)__
@ -23,8 +23,8 @@ First and foremost, you need to meet the following conditions in order to write
### Tools/Programs You Will Need:
- A dev environment/ide that supports:
- __[git](https://git-scm.com/downloads/guis)__
- A dev environment/IDE that supports:
- __[Git](https://git-scm.com/downloads/guis)__
- __[Java 8](https://www.java.com/en/download/faq/java8.xml)__
- __[Gradle](https://gradle.org/)__
- __[Unit testing](https://junit.org/junit5/)__
@ -44,7 +44,7 @@ If you use IntelliJ IDEA, you should know the easy way of importing the NewPipe
1. `git clone` the extractor onto your computer locally.
2. Start IntelliJ Idea and click `Import Project`.
3. Select the root directory of the NewPipe Extractor
3. Select the root directory of the NewPipe Extractor.
4. Select "__Import Project from external Model__" and then choose __Gradle__.
![import from gradle image](img/select_gradle.png)
5. In the next window, select "__Use gradle 'wrapper' task configuration__".
@ -62,20 +62,19 @@ As Gradle Project, select NewPipeExtractor. As a task, add "test". Now save and
After creating you own service, you will need to submit it to our [NewPipeExtractor](https://github.com/teamnewpipe/newpipeextractor)
repository. However, in order to include your changes, you need to follow these rules:
1. Stick to our [Code contribution guidelines](https://github.com/TeamNewPipe/NewPipe/blob/dev/.github/CONTRIBUTING.md#code-contribution)
1. Stick to our [code contribution guidelines](https://github.com/TeamNewPipe/NewPipe/blob/dev/.github/CONTRIBUTING.md#code-contribution).
2. Do not send services that present content we [don't allow](#content-that-is-not-permitted) on NewPipe.
3. You must be willing to maintain your service after submission.
4. Be patient and make the requested changes when one of our maintainers rejects your code.
## Content That is Permitted:
## Content That is Permitted
- Any content that is not in the [list of prohibited content](#content-that-is-not-permitted).
- Any kind of pornography or NSFW content that does not violate US law.
- Advertising, which may need to be approved beforehand.
## Content That is NOT Permitted:
## Content That is NOT Permitted
- Content that is considered NSFL (Not Safe For Life)
- Content that is considered NSFL (Not Safe For Life).
- Content that is prohibited by US federal law (Sexualization of minors, any form of violence, violations of human rights, etc).
- Copyrighted media, without the consent of the copyright holder/publisher.

8
docs/01_Concept_of_the_extractor.md

@ -45,7 +45,7 @@ class MyExtractor extends FutureExtractor {
@Override
public String someDataFiled()
throws ExtractionException { //The exception needs to be thrown if someting failed
throws ExtractionException { //The exception needs to be thrown if something failed
// get piece of information and return it
}
@ -55,9 +55,9 @@ class MyExtractor extends FutureExtractor {
## Collector/Extractor Pattern for Lists
Information can be represented as a list. In NewPipe, a list is represented by a
Information can be represented as a list. In NewPipe, a list is represented by an
[InfoItemsCollector](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/InfoItemsCollector.html).
A InfoItemsCollector will collect and assemble a list of [InfoItem](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/InfoItem.html).
An InfoItemsCollector will collect and assemble a list of [InfoItem](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/InfoItem.html).
For each item that should be extracted, a new Extractor must be created, and given to the InfoItemsCollector via [commit()](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/InfoItemsCollector.html#commit-E-).
![InfoItemsCollector_objectdiagram.svg](img/InfoItemsCollector_objectdiagram.svg)
@ -156,7 +156,7 @@ class MyListExtractor extends ListExtractor {
}
public InfoItemsPage<SomeInfoItem> getInitialPage() {
//document here got initialzied by the fetch() function.
//document here got initialized by the fetch() function.
return getPage(getTheCurrentPageUrl(document));
}
...

14
docs/02_Concept_of_LinkHandler.md

@ -11,7 +11,7 @@ one unique ID that represents it, like this example:
- [https://youtu.be/oHg5SJYRHA0](https://youtu.be/oHg5SJYRHA0) (the shortened link)
- [https://m.youtube.com/watch?v=oHg5SJYRHA0](https://m.youtube.com/watch?v=oHg5SJYRHA0) (the link for mobile devices)
### Importand notes about LinkHandler:
### Important notes about LinkHandler
- A simple `LinkHandler` will contain the default URL, the ID, and the original URL.
- `LinkHandler`s are read only.
- `LinkHandler`s are also used to determine which part of the extractor can handle a certain link.
@ -46,7 +46,7 @@ class MyStreamLinkHandlerFactory extends LinkHandlerFactory {
@Override
public boolean onAcceptUrl(String url) throws ParsingException {
// Return true if this LinkHanlderFactory can handle this type of link
// Return true if this LinkHandlerFactory can handle this type of link.
}
}
```
@ -75,14 +75,6 @@ Through these you can tell the front end which kind of filter your service suppo
You cannot point to a search request with an ID like you point to a playlist or a channel, simply because one and the
same search request might have a different outcome depending on the country or the time you send the request. This is
why the idea of an "ID" is replaced by a "SearchString" in the [SearchQueryHandler](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/linkhandler/SearchQueryHandler.html)
why the idea of an "ID" is replaced by a "SearchString" in the [SearchQueryHandler](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/linkhandler/SearchQueryHandler.html).
These work like regular ListLinkHandler, except that you don't have to implement the methods `onAcceptUrl()`
and `getId()` when overriding [SearchQueryHandlerFactory](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/linkhandler/SearchQueryHandlerFactory.html).

2
docs/03_Implement_a_service.md

@ -30,7 +30,7 @@ The NewPipe Extractor already includes a lot of usable tools and external librar
For some specific (tiny) tasks, Regex is allowed. Here you can take a look at the
[Parser](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/org/schabi/newpipe/extractor/utils/Parser.html),
which will give you a little help with that. __Use Regex with care!!!__ Avoid it as often as possible. It's better to
ask us to introduce a new library than start using Regex to often.
ask us to introduce a new library than start using Regex too often.
- Html/XML Parsing: [jsoup](https://jsoup.org/apidocs/overview-summary.html)
- JSON Parsing: [nanojson](https://github.com/mmastrac/nanojson#parser-example)

10
docs/04_Run_changes_in_App.md

@ -22,14 +22,14 @@ sometimes have to adjust the udev rules in order to
### Run Your Changes on the Extractor
In order to use the extractor in our app, we use [jitpack](https://jitpack.io). This is a build service that can build
In order to use the extractor in our app, we use [JitPack](https://jitpack.io). This is a build service that can build
maven *.jar packages for Android and Java based on GitHub or GitLab repositories.
To use the extractor through jitpack, you need to push it to your online repository of
To use the extractor through JitPack, you need to push it to your online repository of
your copy that you host either on [GitHub](https://github.com) or [GitLab](https://gitlab.com). It's important to host
it on one of both. To copy your repository URL in HTTP format, go to [jitpack](https://jitpack.io/) and paste it there.
it on one of both. To copy your repository URL in HTTP format, go to [JitPack](https://jitpack.io/) and paste it there.
From here, you can grab the latest commit via `GET IT` button.
I recomend not to use a SNAPSHOT, since I am not sure when snapshot is built. An "implementation" string will be generated
I recommend not to use a SNAPSHOT, since I am not sure when snapshot is built. An "implementation" string will be generated
for you. Copy this string and replace the `implementation 'com.github.TeamNewPipe:NewPipeExtractor:<commit>'` line in
the file [/app/build.gradle](https://github.com/TeamNewPipe/NewPipe/blob/dev/app/build.gradle#L58) with it.
@ -45,6 +45,6 @@ with the new extractor.
### Troubleshooting
If something went wrong on jitpack site, you can check their build log, by selecting the commit you tried to build and
If something went wrong on JitPack site, you can check their build log, by selecting the commit you tried to build and
click on that little paper symbol next to the `GET IT` button. If it's red, it means that the build failed.
![jitpack failed to build](img/jitpack_fail.png)

4
docs/05_releasing.md

@ -35,7 +35,7 @@ on the fronted at any time.
### Merging Features/Bugfixes
After finishing a feature, one should open up a __Pull Reuqest__ to the dev branch. From here, a maintainer can do __Code review__ and __Quality Assurance (QA)__.
After finishing a feature, one should open up a __Pull Request__ to the dev branch. From here, a maintainer can do __Code review__ and __Quality Assurance (QA)__.
If you are a maintainer, please take care about the code architecture so __corrosion__ or __code shifting__ can be prevented. Please also prioritize code quality over functionality.
In short: cool function but bad code = no merge. Focus on leaving the code as clean as possible.
@ -53,7 +53,7 @@ Below is a list of things you will want to do:
1. Fork the __dev__ branch into a new __release_x.y.z__ branch.
2. Increase the [version number](#version-nomenclature)
3. Merge [weblate](https://hosted.weblate.org/projects/newpipe/) changes from the `dev` branch at `https://hosted.weblate.org/git/newpipe/strings/`.
3. Merge [Weblate](https://hosted.weblate.org/projects/newpipe/) changes from the `dev` branch at `https://hosted.weblate.org/git/newpipe/strings/`.
4. Copy the [release notes](#release-notes) from the GitHub version draft into the corresponding fastlane file (see [release notes](#release-notes)).
5. Open up a pull request form the new __release_x.y.z__ branch into the __master__ branch.
6. Create an issue pointing to the new pull request. The reason for opening an issue is that from my perception, people read issues more than pull requests. Put the release-note into this pull request.

12
docs/06_documentation.md

@ -20,14 +20,14 @@ Mkdocs is written in [Python](https://www.python.org/) and is distributed throug
MacOS already includes Python, however, pip is still missing. The easiest and most nondestructive way is to install the MacOS package manager, [homebrew](https://brew.sh/index_de), first. The advantage of homebrew is that it will only modify your home directory, and not the root dir, so your OS will not be tampered with.
1. Install [homebrew](https://brew.sh/index_de).
2. Install Python from homebrew, which will also install pip. Enter this command:
2. Install Python from Homebrew, which will also install pip. Enter this command:
`brew install python`.
3. Install mkdocs:
`pip3 install mkdocs`
`pip3 install mkdocs`.
## Linux/*BSD
Linux/*BSD also has Python preinstalled. Most distributions also contain pip by default. If it is not installed, you may need to figure out how to install pip3 through the package manager of your system.
Linux/*BSD also has Python pre-installed. Most distributions also contain pip by default. If it is not installed, you may need to figure out how to install pip3 through the package manager of your system.
1. Install pip3 with these commands according to distributions:
- __Ubuntu/Mint__: `apt install python3-pip`
@ -41,9 +41,9 @@ or run `sudo pip3 install mkdocs` to install mkdocs systemwide. Last one has the
## Android/ChromeOS
This might sound funny, but according to the growing amount of Chromebooks and Android tablets with keyboards, this might actually be useful.
1. Install the [Termux App](https://termux.com/) from [f-droid](https://f-droid.org/packages/com.termux/).
1. Install the [Termux App](https://termux.com/) from [F-Droid](https://f-droid.org/packages/com.termux/).
2. Launch Termux and type `apt update`
3. Install Python and git with the command: `apt install git python`
3. Install Python and Git with the command: `apt install git python`
4. Install mkdocs with `pip install mkdocs`.
From herein, everything will be the same as on Desktop. If you want to edit the files, you can (besides vim or emacs which are available through Termux) use your preferred text editor on Android. This is possible by opening the files with the Termux integration of the build in android file manager:
@ -60,5 +60,3 @@ In order to extend this documentation, you have to clone it from its [GitHub rep
If you are writing a documentation page and want a live preview of it, you can enter the root directory of this documentation project, and then run `mkdocs serve` this will start the mkdocs internal web server on port `8000`. So all you have to do is type `localhost:8000` into the address bar of your browser, and here you go. If you modify a file, and save it, mkdocs will reload the page and show you the new content.
If you want to deploy the page so it will be up to date at the [GitHub pages](https://teamnewpipe.github.io/documentation/), simply type `mkdocs gh-deploy`. However, please be aware that this will not push your changes to the `master` branch of the repository. So, you still have to commit and push your changes to the actual git repository of this documentation. _Please be aware that only privileged maintainers can do this._

4
docs/index.md

@ -1,10 +1,10 @@
# Welcome to NewPipe.
# Welcome to NewPipe
<img width=150 src="https://raw.githubusercontent.com/TeamNewPipe/NewPipe/dev/assets/new_pipe_icon_5.png"/>
This site is/should be a beginner friendly tutorial and documentation for people who want to use or write services for the [NewPipe Extractor](https://github.com/TeamNewPipe/NewPipeExtractor). However, it also contains several notes about how to maintain NewPipe.
It is an addition to our auto generated [jdoc documentation](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/).
It is an addition to our auto generated [Jdoc documentation](https://teamnewpipe.github.io/NewPipeExtractor/javadoc/).
Please be aware that it is in its early stages, so help and [feedback](https://github.com/TeamNewPipe/documentation/issues) is always appreciated :D

Loading…
Cancel
Save