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

Docs for new linkify-html interface #94

Merged
merged 5 commits into from
Dec 23, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ baseurl: "/linkifyjs" # the subpath of your site, e.g. /blog/
url: "http://soapbox.github.io" # the base hostname & protocol for your site
twitter_username: SoapBoxHQ
github_username: SoapBox
version: v2.0.0-beta.5
version: v2.0.0-beta.7

# Build settings
markdown: kramdown
Expand Down
3 changes: 2 additions & 1 deletion _layouts/doc.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
<li><a href="linkify.html"><strong>linkify</strong></a></li>
<ul>
<li><a href="linkify-jquery.html">linkify-jquery</a></li>
<li><a href="linkify-string.html">linkify-string</a></li>
<li><a href="linkify-html.html">linkify-html</a></li>
<li><a href="linkify-element.html">linkify-element</a></li>
<li><a href="linkify-string.html">linkify-string</a></li>
</ul>
<li><strong><a href="plugins.html">Plugins</a></strong></li>
<ul>
Expand Down
2 changes: 1 addition & 1 deletion _sass/bootstrap
Submodule bootstrap updated 41 files
+1 −0 .travis.yml
+9 −0 CHANGELOG.md
+38 −15 README.md
+2 −2 assets/javascripts/bootstrap-sprockets.js
+28 −28 assets/javascripts/bootstrap.js
+3 −3 assets/javascripts/bootstrap.min.js
+2 −2 assets/javascripts/bootstrap/affix.js
+2 −2 assets/javascripts/bootstrap/alert.js
+2 −2 assets/javascripts/bootstrap/button.js
+2 −2 assets/javascripts/bootstrap/carousel.js
+2 −2 assets/javascripts/bootstrap/collapse.js
+4 −4 assets/javascripts/bootstrap/dropdown.js
+2 −2 assets/javascripts/bootstrap/modal.js
+2 −2 assets/javascripts/bootstrap/popover.js
+2 −2 assets/javascripts/bootstrap/scrollspy.js
+2 −2 assets/javascripts/bootstrap/tab.js
+2 −2 assets/javascripts/bootstrap/tooltip.js
+1 −1 assets/javascripts/bootstrap/transition.js
+1 −1 assets/stylesheets/_bootstrap.scss
+2 −2 assets/stylesheets/bootstrap/_button-groups.scss
+7 −6 assets/stylesheets/bootstrap/_carousel.scss
+9 −3 assets/stylesheets/bootstrap/_forms.scss
+2 −2 assets/stylesheets/bootstrap/_glyphicons.scss
+7 −3 assets/stylesheets/bootstrap/_input-groups.scss
+2 −0 assets/stylesheets/bootstrap/_jumbotron.scss
+1 −1 assets/stylesheets/bootstrap/_modals.scss
+2 −2 assets/stylesheets/bootstrap/_pagination.scss
+1 −1 assets/stylesheets/bootstrap/_theme.scss
+1 −1 assets/stylesheets/bootstrap/_type.scss
+2 −0 assets/stylesheets/bootstrap/_variables.scss
+1 −4 assets/stylesheets/bootstrap/mixins/_buttons.scss
+2 −2 assets/stylesheets/bootstrap/mixins/_grid.scss
+1 −1 assets/stylesheets/bootstrap/mixins/_hide-text.scss
+2 −2 assets/stylesheets/bootstrap/mixins/_vendor-prefixes.scss
+6 −6 bootstrap-sass.gemspec
+3 −2 bower.json
+1 −1 composer.json
+2 −2 lib/bootstrap-sass/version.rb
+3 −3 package.json
+1 −1 sache.json
+3 −1 templates/project/_bootstrap-variables.sass
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ npm install linkifyjs
{% highlight js %}
var linkify = require('linkifyjs');
require('linkifyjs/plugin/hashtag')(linkify); // optional
var linkifyStr = require('linkifyjs/string');
var linkifyHtml = require('linkifyjs/html');
{% endhighlight %}

### Example string usage

{% highlight js %}
linkifyStr('The site github.com is #awesome.', {
linkifyHtml('The site github.com is #awesome.', {
defaultProtocol: 'https'
});
{% endhighlight %}
Expand Down
66 changes: 66 additions & 0 deletions docs/linkify-html.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
layout: doc
title: linkify-html · Documentation
---

Interface for replacing links with anchor tags within JavaScript strings containing HTML.

#### Jump to

* [Installation](#installation)
* [Node.js/io.js/Browserify](#nodejsiojsbrowserify)
* [AMD](#amd)
* [Browser globals](#browser-globals)
* [Usage](#usage)

### Installation

### Node.js/io.js/Browserify

```
npm install linkifyjs
```

{% highlight js %}
var linkifyHtml = require('linkifyjs/html');
{% endhighlight %}

### AMD

{% highlight html %}
<script src="linkify.amd.js"></script>
<script src="linkify-html.amd.js"></script>
<script>
require(['linkify-html'], function (linkifyHtml) {
// …
});
</script>
{% endhighlight %}

### Browser globals

{% highlight html %}
<script src="linkify.js"></script>
<script src="linkify-html.js"></script>
{% endhighlight %}

## Usage

{% highlight js %}
var options = {/* … */};
var str = '<p>For help with GitHub.com, please email support@github.com</p>';
linkifyHtml(str, options);
{% endhighlight %}

Returns

{% highlight js %}
'<p>For help with <a href="http://github.com" target="_blank">GitHub.com</a>, please email <a href="mailto:support@github.com">support@github.com</a></p>'
{% endhighlight %}

**Params**

* _`String`_ **`str`** String to linkify
* _`Object`_ [**`options`**] [Options](options.html) hash

**Returns** _`String`_ Linkified htmlString
5 changes: 3 additions & 2 deletions docs/linkify-string.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ layout: doc
title: linkify-string · Documentation
---

Interface for replacing links within native strings with anchor tags. Note that this function will ***not*** parse HTML strings properly - use [`linkify-element`](linkify-element.html) or [`linkify-jquery`](linkify-jquery.html) instead.
Interface for replacing links with anchor tags within JavaScript strings.

Note that this function will ***not*** parse HTML strings properly - use [`linkify-html`](linkify-html.html) instead. Alternatively, if you're using linkify with a DOM, use [`linkify-jquery`](linkify-html.html) or [`linkify-element`](linkify-element.html)

#### Jump to

Expand Down Expand Up @@ -66,4 +68,3 @@ Returns
* _`Object`_ [**`options`**] [Options](options.html) hash

**Returns** _`String`_ Linkified string

13 changes: 4 additions & 9 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,12 @@ <h3>1. Linkify some HTML</h3>
<div class="col-sm-9">
<div class="well demo-well" data-linkify-demo-target="demo-1-linkifier" >
<p class="h1">Why Leaders Need Trust and How To Earn It</p>
<p class="entry-meta"> by Will Campbell (Website: http://soapboxhq.com/blog/author/willcampbell )</p>
<p class="entry-meta"> by Will Campbell (Website: http://soapboxhq.com/blog/author/willcampbell)</p>
<p><time class="updated" datetime="2015-11-18" itemprop="datePublished">November 18, 2015</time></p>

<p>It’s something we all intuitively know: Good leaders are trusted by their employees. A happy, engaged, productive workforce is built on trust, and trust in the person leading the charge is a vital part of this.</p>

<p>Yet <strong>trust isn’t working for many organizations</strong>. A whopping 60 percent of employees don’t trust their workplace ( http://interactionassociates.com/insights/research/building-workplace-trust-201415 ). And this distrust is holding back productivity ( http://www.inc.com/penny-herscher/5-ways-trust-impacts-your-productivity-in-the-office.html ) and <a href="http://soapboxhq.com/blog/why-trust-is-the-core-of-employee-engagement" target="_blank">wounding employee engagement</a>.</p>

<p><strong>Leaders need to start building trust</strong>. In this post you’ll learn more about why trust should be a priority, what Carlos Ghosn can teach us, and get&nbsp;<strong>five tips on how to earn trust</strong>.</p>

<p>Read more at <strong>http://soapboxhq.com/blog/why-leaders-need-trust-and-how-to-earn-it</strong>. If you have any questions, reach out at info@soapboxhq.com</p>

<p>Yet <strong>trust isn’t working for many organizations</strong>. A whopping 60 percent of employees don’t trust their workplace (http://interactionassociates.com/insights/research/building-workplace-trust-201415). And this distrust is holding back productivity (http://www.inc.com/penny-herscher/5-ways-trust-impacts-your-productivity-in-the-office.html) and <a href="http://soapboxhq.com/blog/why-trust-is-the-core-of-employee-engagement" target="_blank">wounding employee engagement</a>.</p>
<p><strong>Leaders need to start building trust</strong>. In this post you’ll learn more about why trust should be a priority, what Carlos Ghosn can teach us, and get <strong>five tips on how to earn trust</strong>.</p>
<p>Read more at <strong>http://soapboxhq.com/blog/why-leaders-need-trust-and-how-to-earn-it</strong>. If you have any questions, reach out at info@soapboxhq.com</p>
</div>
</div>

Expand Down