A platform for community discussion. Free, open, simple.
DOCS: Fix outdated links in developer guides (#38808)
moin-Jana75423f6315b4
diff --git a/docs/developer-guides/docs/02-development-environments/03-docker-setup.md b/docs/developer-guides/docs/02-development-environments/03-docker-setup.mdindex bfc040644ac..b189affaf36 100644--- a/docs/developer-guides/docs/02-development-environments/03-docker-setup.md+++ b/docs/developer-guides/docs/02-development-environments/03-docker-setup.md@@ -128,7 +128,7 @@ d/shutdown_dev; d/boot_dev```shd/boot_dev -p```-- The Dockerfile comes from [discourse/discourse_docker on GitHub](https://github.com/discourse/discourse_docker), in particular [image/discourse_dev](https://github.com/discourse/discourse_docker/tree/master/image/discourse_dev).+- The Dockerfile comes from [discourse/discourse_docker on GitHub](https://github.com/discourse/discourse_docker), in particular [image/discourse_dev](https://github.com/discourse/discourse_docker/tree/main/image/discourse_dev).## Running Testsdiff --git a/docs/developer-guides/docs/02-development-environments/08-local-setup.md b/docs/developer-guides/docs/02-development-environments/08-local-setup.mdindex 8b016835961..32c3e429b82 100644--- a/docs/developer-guides/docs/02-development-environments/08-local-setup.md+++ b/docs/developer-guides/docs/02-development-environments/08-local-setup.md@@ -8,7 +8,7 @@ So you want to set up Discourse locally to hack on and develop with?This root guide links all the #dev-install guides for the various systems to setup Discourse locally on. If you want to add a guide to this list, be sure to tag it `dev-install` before editing this post to include it here.-_(If you want to install Discourse for production use, see [our install guide](https://github.com/discourse/discourse/blob/master/docs/INSTALL.md))_+_(If you want to install Discourse for production use, see [our install guide](https://github.com/discourse/discourse/blob/main/docs/INSTALL.md))_In no particular order, here are the install guides for setting Discourse up on your local environment:diff --git a/docs/developer-guides/docs/02-development-environments/10-fedora-setup.md b/docs/developer-guides/docs/02-development-environments/10-fedora-setup.mdindex 7275deb3e41..4324f7e8c2d 100644--- a/docs/developer-guides/docs/02-development-environments/10-fedora-setup.md+++ b/docs/developer-guides/docs/02-development-environments/10-fedora-setup.md@@ -6,7 +6,7 @@ id: fedora-setupThis guide has been tested against a fresh install of Fedora 31 and 33, but may work on older versions that also use dnf as the package management tool. This is not an official guide but may be useful for other developers using Fedora. This is largely based on the [Ubuntu development guide](https://meta.discourse.org/t/beginners-guide-to-install-discourse-on-ubuntu-for-development/14727), with changes for the different packages for dnf. The assumption is that you do not have any of the packages installed already, although most will be skipped by the tooling if it is already installed.-If you're looking to install Discourse for a **production environment**, prefer the [docker install instructions on github](https://github.com/discourse/discourse/blob/master/docs/INSTALL.md).+If you're looking to install Discourse for a **production environment**, prefer the [docker install instructions on github](https://github.com/discourse/discourse/blob/main/docs/INSTALL.md).**Install required system and development packages**diff --git a/docs/developer-guides/docs/03-code-internals/09-markdown-extensions.md b/docs/developer-guides/docs/03-code-internals/09-markdown-extensions.mdindex 35b47e60630..1761c840cf9 100644--- a/docs/developer-guides/docs/03-code-internals/09-markdown-extensions.md+++ b/docs/developer-guides/docs/03-code-internals/09-markdown-extensions.md@@ -103,9 +103,9 @@ Block level rules apply to multiple lines of text like:`md.block.bbcode.ruler` holds a list of block level rules-There are many examples for inline rules at: [bbcode-inline.js](https://github.com/discourse/discourse/blob/master/app/assets/javascripts/pretty-text/engines/discourse-markdown/bbcode-inline.js)+There are many examples for inline rules at: [bbcode-inline.js](https://github.com/discourse/discourse/blob/main/frontend/discourse-markdown-it/src/features/bbcode-inline.js)-[Quotes](https://github.com/discourse/discourse/blob/master/app/assets/javascripts/pretty-text/engines/discourse-markdown/quotes.js) and polls are good examples of bbcode block rules.+[Quotes](https://github.com/discourse/discourse/blob/main/frontend/discourse-markdown-it/src/features/quotes.js) and polls are good examples of bbcode block rules.#### Inline BBCode rulesdiff --git a/docs/developer-guides/docs/03-code-internals/11-dmodal-api.md b/docs/developer-guides/docs/03-code-internals/11-dmodal-api.mdindex 95d98ef324a..aea21884d5e 100644--- a/docs/developer-guides/docs/03-code-internals/11-dmodal-api.md+++ b/docs/developer-guides/docs/03-code-internals/11-dmodal-api.md@@ -105,4 +105,4 @@ const result = await this.modal.show(MyModal);## More customizability!-`<DModal>` has a number of named blocks and arguments. Check out [the interactive styleguide](https://meta.discourse.org/styleguide/organisms/modal) for arguments, and [the d-modal template implementation](https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/components/d-modal.hbs) for named blocks.+`<DModal>` has a number of named blocks and arguments. Check out [the interactive styleguide](https://meta.discourse.org/styleguide/organisms/modal) for arguments, and [the d-modal template implementation](https://github.com/discourse/discourse/blob/main/frontend/discourse/app/components/d-modal.gjs) for named blocks.diff --git a/docs/developer-guides/docs/03-code-internals/16-authentication-method.md b/docs/developer-guides/docs/03-code-internals/16-authentication-method.mdindex 0b28aa20c2f..73518497a4f 100644--- a/docs/developer-guides/docs/03-code-internals/16-authentication-method.md+++ b/docs/developer-guides/docs/03-code-internals/16-authentication-method.md@@ -12,9 +12,9 @@ This post isn't designed to be a step-by-step instruction manual for adding a ne## Implementing an authenticator-Each authenticator **must** implement a subclass of [Auth::Authenticator](https://github.com/discourse/discourse/blob/master/lib/auth/authenticator.rb). To use the new shared logic, the authenticator **can** instead extend [Auth::ManagedAuthenticator](https://github.com/discourse/discourse/blob/master/lib/auth/managed_authenticator.rb). An example of a bare-bones implementation can be found in the core Facebook authenticator:+Each authenticator **must** implement a subclass of [Auth::Authenticator](https://github.com/discourse/discourse/blob/main/lib/auth/authenticator.rb). To use the new shared logic, the authenticator **can** instead extend [Auth::ManagedAuthenticator](https://github.com/discourse/discourse/blob/main/lib/auth/managed_authenticator.rb). An example of a bare-bones implementation can be found in the core Facebook authenticator:-https://github.com/discourse/discourse/blob/master/lib/auth/facebook_authenticator.rb+https://github.com/discourse/discourse/blob/main/lib/auth/facebook_authenticator.rb`name`, `enabled?` and `register_middleware` must be overridden by implementing classes.@@ -34,7 +34,7 @@ Once an `Authenticator` class has been defined, it needs to be registered. Thisauth_provider authenticator: OpenIDConnectAuthenticator.new()```-In core, registration takes place in [`discourse.rb`](https://github.com/discourse/discourse/blob/b46b6e72d1906ca31e29855bda71f3498c8e203f/lib/discourse.rb#L215-L222). A full list of possible `AuthProvider` options can be found [here](https://github.com/discourse/discourse/blob/master/lib/auth/auth_provider.rb#L8-L12). Text content **can** be defined using these options, but it is better to provide localisable strings in `client.en.yml` following the standard keys. For example:+In core, registration takes place in [`discourse.rb`](https://github.com/discourse/discourse/blob/b46b6e72d1906ca31e29855bda71f3498c8e203f/lib/discourse.rb#L215-L222). A full list of possible `AuthProvider` options can be found [here](https://github.com/discourse/discourse/blob/b46b6e72d1906ca31e29855bda71f3498c8e203f/lib/auth/auth_provider.rb#L8-L12). Text content **can** be defined using these options, but it is better to provide localisable strings in `client.en.yml` following the standard keys. For example:https://github.com/discourse/discourse-openid-connect/blob/88fdf7b5ab624aba7c207e403665e0393334794a/config/locales/client.en.yml#L1-L7@@ -88,6 +88,6 @@ The user is a fresh instance will be populated by session data which is preparedTo provide a seamless switch to the new system, data should be migrated from the old storage location. For core authentication providers, this may be dedicated tables. For plugins, this may be `plugin_store_rows`, or `oauth2_user_infos`. The minimum data required in a `user_associated_accounts` row is `provider_name`, `provider_uid` and `user_id`. For an example migration see:-https://github.com/discourse/discourse/blob/master/db/migrate/20181207141900_migrate_twitter_user_info.rb+https://github.com/discourse/discourse/blob/main/db/migrate/20181207141900_migrate_twitter_user_info.rbOnce the `ManagedAuthenticator` system has been released to the stable branch with v2.2.0, we will begin migrating official authentication **plugins**. At this point, a `plugin_store_row` migration example will be added here.diff --git a/docs/developer-guides/docs/03-code-internals/18-overriding-templates.md b/docs/developer-guides/docs/03-code-internals/18-overriding-templates.mdindex 0edd28cd564..9fac1e2d630 100644--- a/docs/developer-guides/docs/03-code-internals/18-overriding-templates.md+++ b/docs/developer-guides/docs/03-code-internals/18-overriding-templates.md@@ -20,7 +20,7 @@ If you've exhausted all other options, you may need to resort to template overri## Overriding Component Templates-To override an Ember Component template (i.e. anything under [`components/*`](https://github.com/discourse/discourse/tree/main/app/assets/javascripts/discourse/app/components) in Discourse core), you should create an identically-named `.hbs` in your theme/plugin. For example, to override the template for the `badge-button` component in Discourse core, you would create a template file in your theme/plugin at this location:+To override an Ember Component template (i.e. anything under [`components/*`](https://github.com/discourse/discourse/tree/main/frontend/discourse/app/components) in Discourse core), you should create an identically-named `.hbs` in your theme/plugin. For example, to override the template for the `badge-button` component in Discourse core, you would create a template file in your theme/plugin at this location::art: `{theme}/javascripts/discourse/templates/components/badge-button.hbs`@@ -30,7 +30,7 @@ The override must always be nested inside the `/templates` directory, even if th## Overriding Route Templates-Overriding route templates (i.e. all the non-component templates under [`templates/*`](https://github.com/discourse/discourse/tree/main/app/assets/javascripts/discourse/app/templates)) works in the same way as components. Create an identically named template in your theme/plugin. For example, to override `discovery.hbs` in core, you would create a file like+Overriding route templates (i.e. all the non-component templates under [`templates/*`](https://github.com/discourse/discourse/tree/main/frontend/discourse/app/templates)) works in the same way as components. Create an identically named template in your theme/plugin. For example, to override `discovery.hbs` in core, you would create a file like:art: `{theme}/javascripts/discourse/templates/discovery.hbs`diff --git a/docs/developer-guides/docs/04-plugins/04-git-setup.md b/docs/developer-guides/docs/04-plugins/04-git-setup.mdindex 7d0de583416..dcf05bef44d 100644--- a/docs/developer-guides/docs/04-plugins/04-git-setup.md+++ b/docs/developer-guides/docs/04-plugins/04-git-setup.md@@ -35,7 +35,7 @@ git initgit add README.mdgit commit -m "first commit"git remote add origin [email protected]:eviltrout/discourse-plugin-test.git-git push -u origin master+git push -u origin main```Finally, create a `plugin.rb` file for your plugin as explained in [part 1](https://meta.discourse.org/t/beginners-guide-to-creating-discourse-plugins/30515). For this example I just created a dummy one:diff --git a/docs/developer-guides/docs/04-plugins/06-acceptance-tests.md b/docs/developer-guides/docs/04-plugins/06-acceptance-tests.mdindex 6659f9a2ca9..dfb27d34a1d 100644--- a/docs/developer-guides/docs/04-plugins/06-acceptance-tests.md+++ b/docs/developer-guides/docs/04-plugins/06-acceptance-tests.md@@ -94,7 +94,7 @@ To make use of them, add `await pauseTest()` within your test code where you wou### Where to go from here-I hate to sound like a broken record but the [Ember documentation](https://guides.emberjs.com/release/testing/testing-application/) on testing is excellent. You might also want to see how Discourse tests various functionality by browsing the tests in our [javascript tests directory](https://github.com/discourse/discourse/tree/main/app/assets/javascripts/discourse/tests). We have quite a few examples in there you can learn from.+I hate to sound like a broken record but the [Ember documentation](https://guides.emberjs.com/release/testing/testing-application/) on testing is excellent. You might also want to see how Discourse tests various functionality by browsing the tests in our [javascript tests directory](https://github.com/discourse/discourse/tree/main/frontend/discourse/tests). We have quite a few examples in there you can learn from.Happy testing!diff --git a/docs/developer-guides/docs/04-plugins/08-new-locales.md b/docs/developer-guides/docs/04-plugins/08-new-locales.mdindex 94a1bccdeb4..607c8d9e045 100644--- a/docs/developer-guides/docs/04-plugins/08-new-locales.md+++ b/docs/developer-guides/docs/04-plugins/08-new-locales.md@@ -34,7 +34,7 @@ You add the new locale by calling `register_locale`.- The first parameter is required and must be the language code.-- `name` (the English name of the locale) and `nativeName` (the name shown in the user interface) can be omitted, if the language code exists in [`names.yml`](https://github.com/discourse/discourse/blob/master/config/locales/names.yml).+- `name` (the English name of the locale) and `nativeName` (the name shown in the user interface) can be omitted, if the language code exists in [`names.yml`](https://github.com/discourse/discourse/blob/main/config/locales/names.yml).- `fallbackLocale` is the language code that should be used as fall back for missing translations and pluralization rules.@@ -94,9 +94,9 @@ You add the new locale by calling `register_locale`.- The first parameter is required and must be the language code.-- `name` (the English name of the locale) and `nativeName` (the name shown in the user interface) can be omitted, if the language code exists in [`names.yml`](https://github.com/discourse/discourse/blob/master/config/locales/names.yml), otherwise you should set them too.+- `name` (the English name of the locale) and `nativeName` (the name shown in the user interface) can be omitted, if the language code exists in [`names.yml`](https://github.com/discourse/discourse/blob/main/config/locales/names.yml), otherwise you should set them too.-- `plural` describes the language's pluralization rules. Take a look at [`plurals.rb`](https://github.com/discourse/discourse/blob/master/config/locales/plurals.rb) for inspiration. Also, you can omit this parameter if `plurals.rb` already contains your language code.+- `plural` describes the language's pluralization rules. Take a look at [`plurals.rb`](https://github.com/discourse/discourse/blob/main/config/locales/plurals.rb) for inspiration. Also, you can omit this parameter if `plurals.rb` already contains your language code.```rb# name: custom-locales@@ -127,18 +127,6 @@ The content of `assets/locales/foo.js.erb` is quite simple -- make sure you replThe files `config/locales/client.foo.yml` and `config/locales/server.foo.yml` contain the translations you want to use. You don't need to provide all translations needed by Discourse. The English translations will be used in case of missing translations.-##### message_format/\<locale\>.js--`lib/javascripts/locale/message_format/foo.js` contains the pluralization rules used by the client. The rules should be the same as the ones you used in the `register_locale` method. Take a look at the files in [lib/javascripts/locale](https://github.com/discourse/discourse/tree/master/lib/javascripts/locale) for some inspiration. You can omit this file if that directory already contains a file for your language code.--##### moment_js/\<locale\>.js--`lib/javascripts/locale/moment_js/foo.js` contains the locale file used by [moment.js](https://momentjs.com/). Take a look at the files in [vendor/assets/javascripts/moment-locale](https://github.com/discourse/discourse/tree/master/vendor/assets/javascripts/moment-locale) for some inspiration. You can omit this file if that directory already contains a file for your language code.--##### moment_js_timezones/\<locale\>.js--`lib/javascripts/locale/moment_js_timezones/foo.js` contains the locale file used in the timezone dropdown. Take a look at the files in [vendor/assets/javascripts/moment-timezone-names-locale](https://github.com/discourse/discourse/tree/master/vendor/assets/javascripts/moment-timezone-names-locale) for some inspiration. This file is optional.----### FAQdiff --git a/docs/developer-guides/docs/04-plugins/09-chat-integration.md b/docs/developer-guides/docs/04-plugins/09-chat-integration.mdindex 8efe4219382..feb8d2285a2 100644--- a/docs/developer-guides/docs/04-plugins/09-chat-integration.md+++ b/docs/developer-guides/docs/04-plugins/09-chat-integration.md@@ -12,7 +12,7 @@ This post gives a general overview of how things work, but the best way to under## Adding Notification Support :bell:-1. In the [`Provider` folder](https://github.com/discourse/discourse-chat-integration/tree/master/lib/discourse_chat/provider), create a new folder with the name of your chatroom system: e.g. `hipchat`+1. In the [`Provider` folder](https://github.com/discourse/discourse/tree/main/plugins/discourse-chat-integration/lib/discourse_chat_integration/provider), create a new folder with the name of your chatroom system: e.g. `hipchat`2. Create a new ruby file, following the format `hipchat_provider.rb`3. Within that, define a new module inside `DiscourseChat::Provider`. The name of the module **must** end in `Provider` for it to be loaded correctly. Your module must define three constants:- `PROVIDER_NAME`: A string used to reference your provider internally. It shouldn't contain any whitespace. It will likely be the same as the folder name@@ -24,12 +24,12 @@ This post gives a general overview of how things work, but the best way to under- `hidden`: (optional) set this to true to hide this parameter from the list of channels. It will always be shown in the "Edit Channel" modal.[quote]-:information_source: If your channel parameters are not 'human-readable', you may want to add a "Name" parameter, for the user to enter a more useful channel identifier for their reference. See [the hipchat provider](https://github.com/discourse/discourse-chat-integration/blob/master/lib/discourse_chat/provider/hipchat/hipchat_provider.rb#L7) for an example of this.+:information_source: If your channel parameters are not 'human-readable', you may want to add a "Name" parameter, for the user to enter a more useful channel identifier for their reference. See [the hipchat provider](https://github.com/discourse/discourse-chat-integration/blob/28b41954670dc6b1ce52a3b65fdc0ee410f258d1/lib/discourse_chat/provider/hipchat/hipchat_provider.rb#L7) for an example of this.[/quote]-4. Your module must also define the function `self.trigger_notification(post, channel)`. Inside this function you should write code to actually send the notification to your chat system. This will vary based on the provider, but will generally consist of sending a `RESTful` request to their API. Try looking at the implementations of [existing providers](https://github.com/discourse/discourse-chat-integration/tree/master/lib/discourse_chat/provider) to help you.+4. Your module must also define the function `self.trigger_notification(post, channel)`. Inside this function you should write code to actually send the notification to your chat system. This will vary based on the provider, but will generally consist of sending a `RESTful` request to their API. Try looking at the implementations of [existing providers](https://github.com/discourse/discourse/tree/main/plugins/discourse-chat-integration/lib/discourse_chat_integration/provider) to help you.5. Make sure to handle errors returned by your provider's API. You should raise a `DiscourseChat::ProviderError`, and optionally specify a (client side) translation key which gives information about the error. This will be displayed in the admin user interface against the current channel. You can specify additional objects in the `info` hash, which will be included in the site's logs.-6. To make sure Discourse loads your ruby file, you should add a `require_relative` line to the bottom of [provider.rb](https://github.com/discourse/discourse-chat-integration/blob/master/lib/discourse_chat/provider.rb).+6. To make sure Discourse loads your ruby file, you should add a `require_relative` line to the bottom of [provider.rb](https://github.com/discourse/discourse/blob/main/plugins/discourse-chat-integration/lib/discourse_chat_integration/provider.rb).You should end up with something that looks like this:@@ -241,4 +241,4 @@ link = "#{Discourse.base_url}/chat-transcript/#{secret}"The best way to go about implementing transcript support for a new provider is to look at the Slack implementation:-https://github.com/discourse/discourse-chat-integration/blob/master/lib/discourse_chat/provider/slack/slack_transcript.rb+https://github.com/discourse/discourse/blob/main/plugins/discourse-chat-integration/lib/discourse_chat_integration/provider/slack/slack_transcript.rbdiff --git a/docs/developer-guides/docs/05-themes-components/06-theme-structure.md b/docs/developer-guides/docs/05-themes-components/06-theme-structure.mdindex 8257abb24c6..68e47eacc69 100644--- a/docs/developer-guides/docs/05-themes-components/06-theme-structure.md+++ b/docs/developer-guides/docs/05-themes-components/06-theme-structure.md@@ -12,7 +12,7 @@ An example theme is at: https://github.com/SamSaffron/discourse-simple-theme-The git repository will be checked for updates ([once a day](https://github.com/discourse/discourse/blob/master/app/jobs/scheduled/check_out_of_date_themes.rb)), or by using the <kbd>Check for Updates</kbd> button. When changes are detected the <kbd>Check for Updates</kbd> button will change to the <kbd>Update to Latest</kbd>.+The git repository will be checked for updates ([once a day](https://github.com/discourse/discourse/blob/main/app/jobs/scheduled/check_out_of_date_themes.rb)), or by using the <kbd>Check for Updates</kbd> button. When changes are detected the <kbd>Check for Updates</kbd> button will change to the <kbd>Update to Latest</kbd>.diff --git a/docs/developer-guides/docs/05-themes-components/13-core-variables.md b/docs/developer-guides/docs/05-themes-components/13-core-variables.mdindex 7f20313368a..90e0c707901 100644--- a/docs/developer-guides/docs/05-themes-components/13-core-variables.md+++ b/docs/developer-guides/docs/05-themes-components/13-core-variables.md@@ -77,7 +77,7 @@ Ok, on to more advanced topics:Take a look at this file in the Discourse repo:-https://github.com/discourse/discourse/blob/master/app/assets/stylesheets/common/foundation/variables.scss+https://github.com/discourse/discourse/blob/main/app/assets/stylesheets/common/foundation/variables.scssThis is where most of the variables are defined. Just like colors, these variables are magically available for you to use in theme stylesheets.diff --git a/docs/developer-guides/docs/05-themes-components/21-theme-modifiers.md b/docs/developer-guides/docs/05-themes-components/21-theme-modifiers.mdindex ee2a48c7b90..6e24abbd8f3 100644--- a/docs/developer-guides/docs/05-themes-components/21-theme-modifiers.md+++ b/docs/developer-guides/docs/05-themes-components/21-theme-modifiers.md@@ -10,7 +10,7 @@ Introducing: theme modifiers :partying_face:They are specified using the `modifiers` key in your theme's `about.json` file.-For a 100% up-to-date list of modifiers, check the database schema at the bottom of [`theme_modifier_set.rb`](https://github.com/discourse/discourse/blob/master/app/models/theme_modifier_set.rb), but here's a quick summary of what we have so far:+For a 100% up-to-date list of modifiers, check the database schema at the bottom of [`theme_modifier_set.rb`](https://github.com/discourse/discourse/blob/main/app/models/theme_modifier_set.rb), but here's a quick summary of what we have so far:- `serialize_topic_excerpts` **boolean** (default false) - always include excerpts when serializing topic listsdiff --git a/docs/developer-guides/docs/07-theme-developer-tutorial/06-js-api.md b/docs/developer-guides/docs/07-theme-developer-tutorial/06-js-api.mdindex 5f92973a952..831dd3e7325 100644--- a/docs/developer-guides/docs/07-theme-developer-tutorial/06-js-api.md+++ b/docs/developer-guides/docs/07-theme-developer-tutorial/06-js-api.md@@ -103,6 +103,6 @@ For more information on Transformers, check out the [dedicated guide](https://me## Finding more JS API methods-All the available APIs are listed in the [`plugin-api.gjs` source code](https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/lib/plugin-api.gjs) in Discourse core, along with a short description and examples.+All the available APIs are listed in the [`plugin-api.gjs` source code](https://github.com/discourse/discourse/blob/main/frontend/discourse/app/lib/plugin-api.gjs) in Discourse core, along with a short description and examples.That's it for this chapter, and almost the end of the tutorial. Let's wrap things up [in the conclusion](https://meta.discourse.org/t/357802).