-
Notifications
You must be signed in to change notification settings - Fork 142
Add dataTable plugin #2446
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
Merged
Merged
Add dataTable plugin #2446
Changes from all commits
Commits
Show all changes
58 commits
Select commit
Hold shift + click to select a range
ca9703f
Add SortableTable plugin
Tim-Siu 888ce62
Solve `include` not working
Tim-Siu 7b1c13b
Solve undesired behavior when sorting numbers
Tim-Siu bce158d
Update tag to `<m-table sortable>`
Tim-Siu 40519ac
Merge branch 'master' into table
Tim-Siu ddb6590
Switch to use dataTable
Tim-Siu a398c90
Include css and js in the project
Tim-Siu a65a158
Merge branch 'master' into table
Tim-Siu 113f758
Include datatables js in the project
Tim-Siu d9806d4
Add functional test
Tim-Siu aacb32c
Update functional test
Tim-Siu 4869d57
Update site.json for functional test
Tim-Siu e4f398b
Merge branch 'master' into table
Tim-Siu e38deb3
Fix the Vue related incompatibility
Tim-Siu 812748a
Update functional test
Tim-Siu 1533bd4
Fix styling inconsistency
Tim-Siu ffc23c4
Fix redundant scroll bar
Tim-Siu 9ed03f4
Merge branch 'master' into table
Tim-Siu d9819fc
Add comments for the scroll bar fix
Tim-Siu 8e45664
Improve performance and code quality
Tim-Siu 53a492d
Merge branch 'master' into table
Tim-Siu 83f166e
Add documentation
Tim-Siu 3edcd6d
Migrate test cases to v5.4
Tim-Siu 74d1c01
Add unit test
Tim-Siu deec097
Merge branch 'master' into table
Tim-Siu 2dea59e
Improve code quality
Tim-Siu 61910fe
Update test cases
Tim-Siu 1f9e03b
Merge remote-tracking branch 'origin/table'
Tim-Siu 743328e
Merge branch 'master' into table
Tim-Siu fbf0089
Fix typo in documentation
Tim-Siu ba9b648
Fix a bug
Tim-Siu 588a471
Update expected functional test
Tim-Siu 475189a
Merge branch 'master' into table
Tim-Siu c02de83
Update .gitignore to ignore image in functional test
Tim-Siu 94a1d53
Remove generated diagrams
Tim-Siu b3c031f
Merge branch 'master' into table
Tim-Siu b88e401
Update syntax
Tim-Siu 25dfe4f
Revert wrong modifications
Tim-Siu 78e4ae8
Update functional test
Tim-Siu 4d1119c
Merge branch 'master' into table
yucheng11122017 4d83ad4
Support Bootstrap icons
yiwen101 dd740c5
Add references between image and pic in UG
KevinEyo1 d443ac8
Add a reminder when contributor is new to ping all contributor bot
KevinEyo1 77775d5
Remove Overridden Question Attributes in Docs (#2513)
luminousleek 75f0e77
Fix off-positioned close button in imported modal (#2487)
yiwen101 ba27fb6
Clean up functional test
Tim-Siu 8d90deb
Further clean up functional test
Tim-Siu f011514
Merge branch 'master' into table
Tim-Siu 2c6846e
Update documentation
Tim-Siu 224e29a
Merge branch 'master' into table
Tim-Siu 8253f82
Enable seamless panels to inherit any parent's colours (#2501)
jingting1412 122e9f2
Merge branch 'master' into table
Tim-Siu cf6e91b
Clean up code and documentation
Tim-Siu 122fbd8
Merge branch 'master' into table
Tim-Siu 5544ed4
Remove unnecessary pages in `site.json`
Tim-Siu a3180ac
Switch to guard clause
Tim-Siu 989836d
Fix bugs in tests
Tim-Siu e254c05
Clean up code
Tim-Siu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| ### Plugin: DataTable | ||
|
|
||
| The [DataTable](https://datatables.net) plugin enhances the functionality of tables in your MarkBind site by integrating the DataTables library. It allows you to add searching and sorting capabilities to your tables with minimal configuration. The necessary CSS and JavaScript files are already included in the project, so no additional CDN or plugin context configuration is required. | ||
|
|
||
| To enable this plugin, simply add `dataTable` to your site's plugins: | ||
|
|
||
| ```js {heading="site.json"} | ||
| { | ||
| ... | ||
| "plugins": [ | ||
| "dataTable" | ||
| ] | ||
| } | ||
| ``` | ||
|
|
||
| To create a table with DataTable features, use one of the following syntaxes: | ||
|
|
||
| {{ icon_example }} Sortable Table: | ||
|
|
||
| <include src="codeAndOutput.md" boilerplate > | ||
| <variable name="highlightStyle">html</variable> | ||
| <variable name="code"> | ||
| <d-table sortable> | ||
| | Product | Price | Quantity | | ||
| |-----------|-------|----------| | ||
| | Apple | $0.50 | 100 | | ||
| | Banana | $0.75 | 50 | | ||
| | Orange | $0.60 | 75 | | ||
| </d-table> | ||
| </variable> | ||
| </include> | ||
|
|
||
| {{ icon_example }} Searchable Table: | ||
|
|
||
| <include src="codeAndOutput.md" boilerplate > | ||
| <variable name="highlightStyle">html</variable> | ||
| <variable name="code"> | ||
| <d-table searchable> | ||
| | Book Title | Author | Year Published | | ||
| |---------------------------|------------------|----------------| | ||
| | To Kill a Mockingbird | Harper Lee | 1960 | | ||
| | 1984 | George Orwell | 1949 | | ||
| | Pride and Prejudice | Jane Austen | 1813 | | ||
| | The Great Gatsby | F. Scott Fitzgerald | 1925 | | ||
| </d-table> | ||
| </variable> | ||
| </include> | ||
|
|
||
| {{ icon_example }} Sortable and Searchable Table: | ||
|
|
||
| <include src="codeAndOutput.md" boilerplate > | ||
| <variable name="highlightStyle">html</variable> | ||
| <variable name="code"> | ||
| <d-table sortable searchable> | ||
| | City | Country | Population | | ||
| |-------------|-----------|------------| | ||
| | New York | USA | 8,336,817 | | ||
| | London | UK | 9,002,488 | | ||
| | Paris | France | 2,161,063 | | ||
| | Tokyo | Japan | 13,960,236 | | ||
| | Sydney | Australia | 5,367,206 | | ||
| </d-table> | ||
| </variable> | ||
| </include> | ||
|
|
||
| The DataTable plugin automatically renders the table with the specified features based on the presence of the `sortable` and `searchable` attributes in the `<d-table>` tag. You can use either one or both attributes to control the desired functionality for each table. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
packages/cli/test/functional/test_site_table_plugin/_markbind/layouts/default.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| <header> | ||
|
|
||
| </header> | ||
|
|
||
| <div id="flex-body"> | ||
| <div id="content-wrapper"> | ||
| {{ content }} | ||
| </div> | ||
| <scroll-top-button></scroll-top-button> | ||
| </div> | ||
|
|
||
| <footer> | ||
|
|
||
| </footer> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.