在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):github/task_list开源软件地址(OpenSource Url):https://github.com/github/task_list开源编程语言(OpenSource Language):CoffeeScript 57.7%开源软件介绍(OpenSource Introduction):Task ListsNOTE: This repository is no longer supported or updated by GitHub. If you wish to continue to develop this code yourself, we recommend you fork it. This package provides various components necessary for integrating Task Lists into your GitHub-flavored-Markdown user content. ComponentsThe Task List feature is made of several different components:
Usage & IntegrationThe backend components are designed for rendering the Task List item checkboxes, and the frontend components handle updating the Markdown source (embedded in the markup). Backend: Markdown pipeline filterRendering Task List item checkboxes from source Markdown depends on the require 'html/pipeline'
require 'task_list/filter'
pipeline = HTML::Pipeline.new [
HTML::Pipeline::MarkdownFilter,
TaskList::Filter
]
pipeline.call "- [ ] task list item" Frontend: Markdown UpdatesTask List updates on the frontend require specific HTML markup structure, and must be enabled with JavaScript. Rendered HTML (the - [ ] text <div class="js-task-list-container">
<ul class="task-list">
<li class="task-list-item">
<input type="checkbox" class="js-task-list-item-checkbox" disabled />
text
</li>
</ul>
<form>
<textarea class="js-task-list-field">- [ ] text</textarea>
</form>
</div> Enable Task List updates with: $('.js-task-list-container').taskList('enable') NOTE: Updates are not persisted to the server automatically. Persistence is the responsibility of the integrating application, accomplished by hooking into the Read through the documented behaviors and samples in the source for more detail, including documented events. InstallationTask Lists are packaged as both a RubyGem with both backend and frontend behavior, and a Bower package with just the frontend behavior. Backend: RubyGemFor the backend Ruby components, add this line to your application's Gemfile:
And then execute:
Frontend: BowerFor the frontend components, add This is the preferred method for including the frontend assets in your application. Alternatively, for Rails methods using Frontend: Rails 3+ Railtie method# config/application.rb
require 'task_list/railtie' Frontend: Rails 2.3 Manual methodWherever you have your Sprockets setup: Sprockets::Environment.new(Rails.root) do |env|
# Load TaskList assets
require 'task_list/railtie'
TaskList.asset_paths.each do |path|
env.append_path path
end
end If you're not using Sprockets, you're on your own but it's pretty straight
forward. DependenciesAt a high level, the Ruby components integrate with the Testing and DevelopmentJavaScript unit tests can be run with Ruby unit tests can be run with Functional tests are useful for manual testing in the browser. To run, install
the necessary components with
Navigate to http://localhost:4011/test/functional/test_task_lists_behavior.html Community IntegrationContributingRead the Contributing Guidelines and open a Pull Request! |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论