Skip to content
This repository was archived by the owner on Nov 1, 2017. It is now read-only.

Commit 65abc79

Browse files
committed
Merge pull request #917 from github/update-1449272480
2 parents ba19350 + c9b920e commit 65abc79

10 files changed

+25
-17
lines changed

Rakefile

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
require_relative 'lib/resources'
22
require 'tmpdir'
33

4+
Dir.glob('tasks/**/*.rake').each { |r| load r }
5+
46
task :default => [:test]
57

68
desc 'Builds the site'
@@ -28,8 +30,8 @@ task :run_proofer do
2830
latest_ent_version = GitHub::Resources::Helpers::CONTENT['LATEST_ENTERPRISE_VERSION']
2931
# swap versionless Enterprise articles with versioned paths
3032
href_swap = {
31-
%r{help\.github\.com/enterprise/admin/} => "help.github.com/enterprise/#{latest_ent_version}/admin/",
32-
%r{help\.github\.com/enterprise/user/} => "help.github.com/enterprise/#{latest_ent_version}/user/"
33+
%r{help\.github\.com/enterprise/admin/} => "help.github.com/enterprise/#{config[:versions][0]}/admin/",
34+
%r{help\.github\.com/enterprise/user/} => "help.github.com/enterprise/#{config[:versions][0]}/user/"
3335
}
3436
HTML::Proofer.new("./output", :href_ignore => ignored_links, :href_swap => href_swap).run
3537
end

content/changes/2014-06-23-the-github-enterprise-api-documentation-has-a-new-home.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ author_name: gjtorikian
77

88
[GitHub Enterprise](https://enterprise.github.com) offers the same set of APIs as GitHub.com, as well as its own set of Enterprise-specific functionality.
99

10-
The GitHub Enterprise API has been documented on [the Enterprise Help site](https://enterprise.github.com/help) for some time. We've now [moved the resources to this site](https://developer.github.com/v3/enterprise/) to be hosted alongside the rest of the GitHub API documentation.
10+
The GitHub Enterprise API has been documented on the Enterprise Help for some time. We've now [moved the resources to this site](https://developer.github.com/v3/enterprise/) to be hosted alongside the rest of the GitHub API documentation.
1111

1212
Is there an API workflow you're particularly interested in? [Let us know](https://github.com/contact?form%5Bsubject%5D=Suggestion+for+an+Enterprise+Guide) and we'll do our best to [write a guide](https://developer.github.com/guides/)!

content/changes/2014-08-05-team-memberships-api.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ We expect the preview period to last 30-60 days. At the end of the preview perio
3030
If you have any questions or feedback, please [get in touch with us][contact]!
3131

3232
[contact]: https://github.com/contact?form[subject]=Team+Memberships+API
33-
[org-invitations]: https://help.github.com/articles/adding-or-inviting-members-to-a-team-in-an-organization
33+
[org-invitations]: https://help.github.com/articles/adding-organization-members-to-a-team
3434
[add-team-member]: /v3/orgs/teams/#add-team-member
3535
[add-team-membership]: /v3/orgs/teams/#add-team-membership
3636
[get-team-member]: /v3/orgs/teams/#get-team-member

content/changes/2014-08-28-accepting-organization-invitations-from-the-api.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ If you have any questions or feedback, please [get in touch with us][contact]!
3131

3232
[contact]: https://github.com/contact?form[subject]=Team+Memberships+API
3333
[team-memberships-api]: /changes/2014-08-05-team-memberships-api/
34-
[org-invitations]: https://help.github.com/articles/adding-or-inviting-members-to-a-team-in-an-organization
34+
[org-invitations]: https://help.github.com/articles/adding-organization-members-to-a-team
3535
[list-org-memberships]: /v3/orgs/members/#list-your-organization-memberships
3636
[edit-org-membership]: /v3/orgs/members/#edit-your-organization-membership
3737
[add-team-membership]: /v3/orgs/teams/#add-team-membership

content/v3/enterprise.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Enterprise
33
---
44

5-
# Enterprise <%= fetch_content(:latest_enterprise_version) %>
5+
# Enterprise <%= config[:versions][0] %>
66

77
{:toc}
88

@@ -37,7 +37,7 @@ Every Enterprise API endpoint is only accessible to GitHub Enterprise site admin
3737

3838
## Past Releases
3939

40-
The latest release for GitHub Enterprise is <%= fetch_content(:latest_enterprise_version) %>. The GitHub APIs available to this release are located at <https://developer.github.com/enterprise/<%= fetch_content(:latest_enterprise_version) %>/>.
40+
The latest release for GitHub Enterprise is <%= config[:versions][0] %>. The GitHub APIs available to this release are located at <https://developer.github.com/enterprise/<%= config[:versions][0] %>/>.
4141

4242
Documentation for the API that's bundled with your GitHub Enterprise appliance is available for past releases:
4343

layouts/sidebar.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ <h3><a href="#" class="js-expand-btn collapsed arrow-btn" data-proofer-ignore></
114114
</ul>
115115
</li>
116116
<li class="js-topic">
117-
<h3><a href="#" class="js-expand-btn collapsed arrow-btn" data-proofer-ignore></a><a href="/v3/enterprise/">Enterprise <%= fetch_content(:latest_enterprise_version) %></a></h3>
117+
<h3><a href="#" class="js-expand-btn collapsed arrow-btn" data-proofer-ignore></a><a href="/v3/enterprise/">Enterprise <%= config[:versions][0] %></a></h3>
118118
<ul class="js-guides">
119119
<li><a href="/v3/enterprise/admin_stats/">Admin Stats</a></li>
120120
<li><a href="/v3/enterprise/ldap/">LDAP</a></li>

lib/enterprise-only.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ class EnterpriseOnlyFilter < Nanoc::Filter
22
identifier :enterprise_only_filter
33
type :text
44

5-
ENTERPRISE_START_STRING = '{{#enterprise-only}}'
6-
ENTERPRISE_END_STRING = '{{/enterprise-only}}'
5+
ENTERPRISE_START_STRING = '#enterprise-only'
6+
ENTERPRISE_END_STRING = '/enterprise-only'
77

88
# if we're running in Dotcom mode, we'll be lazy and just hide the content.
99
# otherwise, when running script/enterprise-cutter, we'll bring these sections back
1010
def run(content, params={})
1111
start_replacement = '<div class="enterprise-only">'
1212
end_replacement = '</div>'
1313

14-
content = content.gsub(%r{<p>#{ENTERPRISE_START_STRING}</p>}, start_replacement)
15-
content = content.gsub(%r{<p>#{ENTERPRISE_END_STRING}</p>}, end_replacement)
14+
content = content.gsub(%r{<p>\[\[#{ENTERPRISE_START_STRING}\]\]</p>}, start_replacement)
15+
content = content.gsub(%r{<p>\[\[#{ENTERPRISE_END_STRING}\]\]</p>}, end_replacement)
1616

1717
content
1818
end

lib/not-enterprise.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ class NotEnterpriseFilter < Nanoc::Filter
22
identifier :not_enterprise_filter
33
type :text
44

5-
ENTERPRISE_START_STRING = '{{#not-enterprise}}'
6-
ENTERPRISE_END_STRING = '{{/not-enterprise}}'
5+
ENTERPRISE_START_STRING = '#not-enterprise'
6+
ENTERPRISE_END_STRING = '/not-enterprise'
77

88
# if we're running in Dotcom mode, we'll be lazy and just hide the content.
99
# otherwise, when running script/enterprise-cutter, we'll bring these sections back
1010
def run(content, params={})
1111
start_replacement = '<div class="not-enterprise">'
1212
end_replacement = '</div>'
1313

14-
content = content.gsub(%r{<p>#{ENTERPRISE_START_STRING}</p>}, start_replacement)
15-
content = content.gsub(%r{<p>#{ENTERPRISE_END_STRING}</p>}, end_replacement)
14+
content = content.gsub(%r{<p>\[\[#{ENTERPRISE_START_STRING}\]\]</p>}, start_replacement)
15+
content = content.gsub(%r{<p>\[\[#{ENTERPRISE_END_STRING}\]\]</p>}, end_replacement)
1616

1717
content
1818
end

lib/resources.rb

-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ def webhook_payload(event_name)
123123
end
124124

125125
CONTENT ||= {
126-
'LATEST_ENTERPRISE_VERSION' => '2.4',
127126
'IF_SITE_ADMIN' => "If you are an [authenticated](/v3/#authentication) site administrator for your Enterprise instance,",
128127
"PUT_CONTENT_LENGTH" => "Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see \"[HTTP verbs](/v3/#http-verbs).\"",
129128
"OPTIONAL_PUT_CONTENT_LENGTH" => "Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see \"[HTTP verbs](/v3/#http-verbs).\"",

tasks/utils.rake

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
def config
2+
@config ||= symbolize_hash(YAML.load_file(File.join(File.dirname(__FILE__), '..', 'nanoc.yaml')))
3+
end
4+
5+
def symbolize_hash(hash)
6+
JSON.parse(JSON[hash], symbolize_names: true)
7+
end

0 commit comments

Comments
 (0)