Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add languages support #264

Merged
merged 52 commits into from
Sep 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
4e46bd4
add version, language and document models
saleem-hadad Mar 30, 2021
e9b49da
update Document model
saleem-hadad May 11, 2021
231d6d4
update config
saleem-hadad May 11, 2021
8b2f942
add abstract class Model, update tests
saleem-hadad May 11, 2021
a319ba3
update model to have attributes instead of properties
saleem-hadad May 11, 2021
39308cb
version has many documents
saleem-hadad May 11, 2021
bb4618b
update models
saleem-hadad May 12, 2021
f75fcd1
add Language and SEO tests
saleem-hadad May 12, 2021
226b579
refactoring
saleem-hadad May 12, 2021
7afa38d
add RequestPathParser, DocumentFiner, some cleanup
saleem-hadad May 13, 2021
fe797d3
enhance markdown parser to be from DI
saleem-hadad May 13, 2021
61e3943
refactoring
saleem-hadad May 13, 2021
3ed3ff9
wip
saleem-hadad May 14, 2021
557ee11
refactoring
saleem-hadad May 16, 2021
96afdce
wip
saleem-hadad May 16, 2021
ac8aae9
fix tests
saleem-hadad May 16, 2021
258a2d1
wip
saleem-hadad May 16, 2021
594ab15
update DocumentationController
saleem-hadad Jul 16, 2021
3758b16
wip
saleem-hadad Jul 16, 2021
550c87f
wip
saleem-hadad Jul 16, 2021
9fb6b8d
wip
saleem-hadad Jul 16, 2021
de69df1
wip
saleem-hadad Jul 16, 2021
55af4ce
wip
saleem-hadad Jul 19, 2021
69f09b2
wip
saleem-hadad Jul 19, 2021
6e28380
remove mousetrap
saleem-hadad Jul 19, 2021
083b343
remove mousetrap
saleem-hadad Jul 19, 2021
4304eaf
circleci
saleem-hadad Aug 19, 2021
af7df64
circleci
saleem-hadad Aug 19, 2021
ca76a15
wip
saleem-hadad Aug 19, 2021
18a3887
wip
saleem-hadad Aug 19, 2021
b483125
wip
saleem-hadad Aug 19, 2021
4e5accf
wip
saleem-hadad Aug 19, 2021
eca3403
wip
saleem-hadad Aug 19, 2021
37a7062
wip
saleem-hadad Aug 19, 2021
7b41f12
wip
saleem-hadad Aug 19, 2021
ca3199d
wip
saleem-hadad Aug 19, 2021
66a58e0
wip
saleem-hadad Aug 19, 2021
988f8f8
wip
saleem-hadad Aug 19, 2021
b3cbac3
wip
saleem-hadad Aug 19, 2021
c8ad974
wip
saleem-hadad Aug 19, 2021
45fa779
wip
saleem-hadad Aug 19, 2021
7ab4ce6
wip
saleem-hadad Aug 19, 2021
dd14f57
wip
saleem-hadad Aug 19, 2021
a54024e
wip
saleem-hadad Sep 1, 2021
5b10233
wip
saleem-hadad Sep 1, 2021
9a15f8e
wip
saleem-hadad Sep 1, 2021
c6a313d
wip
saleem-hadad Sep 2, 2021
3be1d9d
wip
saleem-hadad Sep 2, 2021
0bc15a4
wip
saleem-hadad Sep 2, 2021
8dfa094
wip
saleem-hadad Sep 2, 2021
dd565e4
wip
saleem-hadad Sep 2, 2021
d49cb7f
wip
saleem-hadad Sep 2, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: 2
jobs:
build:
docker:
- image: circleci/php:7.2-stretch

steps:
- checkout

- run: sudo apt update
- run: sudo docker-php-ext-install zip
- restore_cache:
keys:
- composer-v1-{{ checksum "composer.json" }}
- composer-v1-
- run: COMPOSER_MEMORY_LIMIT=-1 composer install --no-interaction --prefer-dist --optimize-autoloader
- save_cache:
key: composer-v1-{{ checksum "composer.json" }}
when: always
paths:
- vendor

- run: ./vendor/bin/phpunit
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ This Code of Conduct applies both within project spaces and in public spaces whe

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

Expand Down
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,32 @@ This project exists thanks to all the people who contribute. [[Contribute](CONTR
## License

This library is licensed under the MIT License - see the [LICENSE.md](LICENSE) file for details.


# TODO

- Removed SEO from config
- Migrate fourom to external plugin

'forum' => [
'enabled' => false,
'default' => 'disqus',
'services' => [
'disqus' => [
'site_name' => '', // yoursite.disqus.com
]
]
],

- Removed packages from config

'packages' => [
'path' => 'larecipe-components',
],

- Removed fa_v4_shims from ui in config
- Removed show_side_bar from ui in config
- Add enabled flag to versions in config
- Add languages in config
- Correct config comments

12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@
"authors": [
{
"name": "Saleem Hadad",
"email": "[email protected]"
"email": "[email protected]"
}
],
"require": {
"php": ">=7.1.3",
"illuminate/support": "^5.4|^6.0|^7.0|^8.0",
"illuminate/view": "^5.4|^6.0|^7.0|^8.0",
"erusev/parsedown-extra": "^0.8.1",
"symfony/dom-crawler": "^4.1|^5.0"
"illuminate/support": "^6.0|^7.0|^8.0",
"illuminate/view": "^6.0|^7.0|^8.0",
"symfony/dom-crawler": "^4.1|^5.0",
"league/commonmark": "^1.5"
},
"require-dev": {
"phpunit/phpunit": "^7.0|^8.0|^9.0",
"laravel/framework": "^5.4|^6.0|^7.0|^8.0",
"laravel/framework": "^6.0|^7.0|^8.0",
"orchestra/testbench": "^3.4|^4.0|^5.0"
},
"autoload": {
Expand Down
208 changes: 20 additions & 188 deletions publishable/config/larecipe.php
Original file line number Diff line number Diff line change
@@ -1,207 +1,39 @@
<?php

return [
/*
|--------------------------------------------------------------------------
| Documentation Routes
|--------------------------------------------------------------------------
|
| These options configure the behavior of the LaRecipe docs basic route
| where you can specify the url of your documentations, the location
| of your docs and the landing page when a user visits /docs route.
|
|
*/
'path' => env('LARECIPE_PATH', '/docs'),

'docs' => [
'route' => '/docs',
'path' => '/resources/docs',
'landing' => 'overview',
'middleware' => ['web'],
],
'source' => 'resources/docs',

/*
|--------------------------------------------------------------------------
| Documentation Versions
|--------------------------------------------------------------------------
|
| Here you may specify and set the versions and the default (latest) one
| of your documentation's versions where you can redirect the user to.
| Just make sure that the default version is in the published list.
|
|
*/
'landing' => 'overview',

'versions' => [
'default' => '1.0',
'languages' => [
'enabled' => true,
'default' => 'en',
'published' => [
'1.0'
]
],

/*
|--------------------------------------------------------------------------
| Documentation Settings
|--------------------------------------------------------------------------
|
| These options configure the additional behaviors of your documentation
| where you can limit the access to only authenticated users in your
| system. It is false initially so that guests can view your docs.
| Middleware can be defined if auth is set to false. For example, if you want all users to be able to access your docs,
| use web middleware. If you want just auth users, use auth middleware. Or, make your own middleware
| to handle who can see your docs (don't forget to use gates for more granular control!).
|
|
*/

'settings' => [
'auth' => false,
'ga_id' => '',
'middleware' => [
'web',
'en'
]
],

/*
|--------------------------------------------------------------------------
| Cache
|--------------------------------------------------------------------------
|
| Obviously rendering markdown at the back-end is costly especially if
| the rendered files are massive. Thankfully, caching is considered
| as a good option to speed up your app when having high traffic.
|
| Caching period unit: minutes
|
*/

'cache' => [
'enabled' => false,
'period' => 5
],

/*
|--------------------------------------------------------------------------
| Search
|--------------------------------------------------------------------------
|
| Here you can add configure the search functionality of your docs.
| You can choose the default engine of your search from the list
| However, you can also enable/disable the search's visibility
|
| Supported Search Engines: 'algolia', 'internal'
|
*/

'search' => [
'enabled' => false,
'default' => 'algolia',
'engines' => [
'internal' => [
'index' => ['h2', 'h3']
],
'algolia' => [
'key' => '',
'index' => ''
]
'versions' => [
'enabled' => true,
'default' => '1.0',
'published' => [
'1.0'
]
],

/*
|--------------------------------------------------------------------------
| Appearance
|--------------------------------------------------------------------------
|
| Here you can add configure the appearance of your docs. For example,
| you can set the primary and secondary colors that will give your
| documentation a unique look. You can set the fav of your docs.
|
|
*/

'ui' => [
'code_theme' => 'dark', // or: light
'fav' => '', // eg: fav.png
'fa_v4_shims' => true, // Add FontAwesome v4 shims prevent BC break
'show_side_bar' => true,
'colors' => [
'primary' => '#787AF6',
'secondary' => '#2b9cf2'
],

'theme_order' => null // ['LaRecipeDarkTheme', 'customTheme']
'middleware' => [
'web',
],

/*
|--------------------------------------------------------------------------
| SEO
|--------------------------------------------------------------------------
|
| These options configure the SEO settings of your docs. You can set the
| author, the description and the keywords. Also, LaRecipe by default
| sets the canonical link to the viewed page's link automatically.
|
|
*/

'seo' => [
'author' => '',
'description' => '',
'keywords' => '',
'og' => [
'title' => '',
'type' => 'article',
'url' => '',
'image' => '',
'description' => '',
]
'cache' => [
'enabled' => false,
'duration' => 5
],

/*
|--------------------------------------------------------------------------
| Forum
|--------------------------------------------------------------------------
|
| Giving a chance to your users to post their questions or feedback
| directly on your docs, is pretty nice way to engage them more.
| However, you can also enable/disable the forum's visibility.
|
| Supported Services: 'disqus'
|
*/

'forum' => [
'enabled' => false,
'default' => 'disqus',
'services' => [
'disqus' => [
'site_name' => '', // yoursite.disqus.com
]
]
],

/*
|--------------------------------------------------------------------------
| Components and Packages
|--------------------------------------------------------------------------
|
| Once you create a new asset or theme, its directory will be
| published under `larecipe-components` folder. However, If
| you want a different location, feel free to change it.
|
|
*/

'packages' => [
'path' => 'larecipe-components',
'branding' => [
'primary' => '#787AF6',
'secondary' => '#2b9cf2',
],

'blade-parser' => [
'regex' => [
'code-blocks' => [
'match' => '/\<pre\>(.|\n)*?<\/pre\>/',
'replacement' => '<code-block>',
]
]
]
];
39 changes: 0 additions & 39 deletions resources/js/Larecipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ export default class LaRecipe {
this.setupSmoothScrolling();
this.activateCurrentSection();
this.parseDocsContent();
this.setupKeyboardShortcuts();
mediumZoom(".documentation img");
},
methods: {
Expand Down Expand Up @@ -171,44 +170,6 @@ export default class LaRecipe {
$(this).html(html);
}
});
},
setupKeyboardShortcuts() {
// keyboard magic 🎹
const Mousetrap = require("./vendor/mousetrap.js");

// toggle the sidebar
Mousetrap.bind("/", e => {
e.preventDefault();
this.sidebar = !this.sidebar;
});

// open the search box
Mousetrap.bind("s", e => {
e.preventDefault();
this.searchBox = true;
});

// scroll to the top of the page
Mousetrap.bind("t", e => {
e.preventDefault();
$("html,body").animate(
{
scrollTop: 0
},
500
);
});

// scroll to the bottom of the page
Mousetrap.bind("b", e => {
e.preventDefault();
$("html,body").animate(
{
scrollTop: $(document).height()
},
500
);
});
}
}
});
Expand Down
11 changes: 0 additions & 11 deletions resources/js/vendor/mousetrap.js

This file was deleted.

Loading