Skip to content

Commit f434b0c

Browse files
authored
Merge pull request #484 from datacamp/revert-482-fix/queue-parsing
Revert "[CT-3601] Update API to not handle some sections as custom"
2 parents 5c79efe + 36fb4fd commit f434b0c

File tree

2 files changed

+15
-28
lines changed

2 files changed

+15
-28
lines changed

README.md

+7-23
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@ R documentation sifts through all CRAN, GitHub and BioConductor packages hourly,
77
The RDocs project is completely open-source. This repository contains the source code for the NodeJS web application that serves [www.rdocumentation.org](https://www.rdocumentation.org). For other codebases, you can check out [`CONTRIBUTING.md`](CONTRIBUTING.md).
88

99
## Features
10-
11-
- Quick search through all packages and functions
12-
10+
- Quick search through all packages and functions
11+
1312
![screen shot 2016-08-25 at 14 07 05](https://cloud.githubusercontent.com/assets/1741726/17968459/41bee176-6acd-11e6-9431-3aec36ffd8c8.png)
14-
13+
1514
- Complete search through all packages and function
16-
15+
1716
![screen shot 2016-08-25 at 14 08 52](https://cloud.githubusercontent.com/assets/1741726/17968498/7ce9a6aa-6acd-11e6-9276-4d5ced4523b3.png)
18-
17+
1918
- Easily assess package quality
2019

2120
![screen shot 2016-08-25 at 14 11 27](https://cloud.githubusercontent.com/assets/1741726/17968583/df47301a-6acd-11e6-9a28-5167b768fbf1.png)
2221

23-
- Post _community examples_ to help the community understand how to use a function
22+
- Post *community examples* to help the community understand how to use a function
2423

2524
![screen shot 2016-08-25 at 14 14 37](https://cloud.githubusercontent.com/assets/1741726/17968654/492bb8f2-6ace-11e6-8a64-c620e9e98efa.png)
2625

26+
2727
## What this app does
2828

2929
This application is part the rdocumentation project. This app is responsible for storing the RDocumentation data, and bring it to the users through a web interface (the rdocumentation.org site) or through an api (See https://www.rdocumentation.org/docs/ for the public API)
@@ -33,33 +33,19 @@ This application is part the rdocumentation project. This app is responsible for
3333
Documentation of the differents endpoints can be found here: http://www.rdocumentation.org/docs/
3434

3535
## Issue/Feature request
36-
3736
Please post a new issue at https://github.com/datacamp/rdocumentation-app/issues for any bug that you encounter or a feature that you would like to see in rdocumetation.org.
3837

3938
## Development
4039

4140
### Using docker
42-
4341
You'll need docker and docker-compose to run this stack locally
4442

4543
- Copy the .env.sample to .env and change relevant variables
4644
- `docker-compose create` to create the redis and mysql container
4745
- `docker-compose start` to fire up a local redis an mysql
48-
- Use the same node version in your terminal as the Dockerfile is using: `nvm use 8.16`
49-
- `npm install`
5046
- Run the database migrations by doing `npm run migrate`
5147
- `npm run start-dev`
5248

53-
### Troubleshooting
54-
55-
If you get an error: `SequelizeConnectionError: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client`
56-
follow these steps:
57-
58-
1. Access your mysql container: you can do it either through the docker app by clicking on the "cli" button of the container, or in your terminal by running `docker exec -it <mysql_container_id> bash`
59-
2. `mysql -u root -p`
60-
3. Enter: `password`
61-
4. `ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password'`
62-
6349
## How to deploy
6450

6551
- To deploy to stating (rdocumentation.datacamp-staging.com), merge to master
@@ -70,15 +56,13 @@ The rdocumentation app is hosted on DataCamp's infrastructure, on our AWS ECS cl
7056
## What the CI does
7157

7258
This application runs on the DataCamp infrastructure. Our custom CI flow will:
73-
7459
- Build a docker image
7560
- Upload it the ECR
7661
- Deploy the new version to ECS
7762

7863
## How to contribute
7964

8065
We welcome any contributions that could improves rdocumentation.org. There is multiple ways of contributing:
81-
8266
- Report when some packages are missing/outdated/incorrect by creating an issue.
8367
- Report bugs.
8468
- Help us improves by proposing features.

api/models/Topic.js

+8-5
Original file line numberDiff line numberDiff line change
@@ -233,12 +233,8 @@ module.exports = {
233233
topic.usage = topic.usage.contents;
234234
}
235235

236-
if (topic.description !== null && typeof topic.description === 'object') {
237-
topic.description = topic.description.contents;
238-
}
239-
240236
topic.examples = sanitizeHtml(topic.examples, {
241-
allowedTags: [],
237+
allowedTags: ['a' ],
242238
allowedAttributes: {}
243239
});
244240

@@ -319,6 +315,11 @@ module.exports = {
319315
'sourceJSON'])
320316
);
321317

318+
var topicArguments = _.isEmpty(rdJSON.arguments) ? [] : rdJSON.arguments.map(function(argument) {
319+
var arg = _.mapValues(argument, arrayToString);
320+
return _.merge({}, arg, {topic_id: topicInstance.id});
321+
});
322+
322323
var aliases = rdJSON.aliases && !(rdJSON.aliases instanceof Array) ? [rdJSON.aliases] : rdJSON.aliases;
323324
var aliasesRecords = _.isEmpty(aliases) ? [] : aliases.map(function(alias) {
324325
return {name: alias, topic_id: topicInstance.id};
@@ -331,8 +332,10 @@ module.exports = {
331332
});
332333

333334
return Promise.all([
335+
topicInstance.removeArguments(topicInstance.arguments),
334336
topicInstance.removeSections(topicInstance.sections),
335337
topicInstance.removeAliases(topicInstance.aliases),
338+
Argument.bulkCreate(topicArguments, {transaction: t}),
336339
Alias.bulkCreate(aliasesRecords, {transaction: t}),
337340
Section.bulkCreate(sections, {transaction: t}),
338341
topicInstance.setKeywords(keywordsInstances, {transaction: t }),

0 commit comments

Comments
 (0)