Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitabbda12

Browse files
committed
Sync with upstream repository
1 parent4dd83c1 commitabbda12

18 files changed

+299
-143
lines changed

‎assets/stylesheets/documentation.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ a img {
214214
margin-bottom:0;
215215
clear: both;
216216
height:61px;
217-
background: url(../images/header.png)00 repeat-x;
217+
background:url(/assets/images/header.png)00 repeat-x;
218218
}
219219

220220
#header {
@@ -1382,7 +1382,7 @@ pre span.comment {color: #aaa;}
13821382
@mediaonly screenand (-webkit-min-device-pixel-ratio:2),only screenand (min-resolution:192dpi) {
13831383

13841384
#header-wrapper {
1385-
background-image:url(../images/header@2x.png);
1385+
background-image:url(/assets/images/header@2x.png);
13861386
background-size:8px61px;
13871387
}
13881388

‎content/changes/2015-06-24-api-enhancements-for-working-with-organization-permissions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ We would love to hear your thoughts on these enhancements. If you have any quest
7878
[add-team-membership]:/v3/orgs/teams/#add-team-membership
7979
[list-team-repos]:/v3/orgs/teams/#list-team-repos
8080
[get-team-repo]:/v3/orgs/teams/#check-if-a-team-manages-a-repository
81-
[add-team-repo]:/v3/orgs/teams/#add-team-repository
81+
[add-team-repo]:/v3/orgs/teams/#add-or-update-team-repository
8282
[org-members-list]:/v3/orgs/members/#members-list
8383
[org-public-members-list]:/v3/orgs/members/#public-members-list
8484
[list-collabs]:/v3/repos/collaborators/#list-collaborators

‎content/search/search-index.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
[
2+
<% if @config[:audience]%>
3+
<% @preface = "/enterprise/#{@config[:audience]}" %>
4+
<% end %>
25
<% @items.select { |item| !item.attributes[:hide_from_search] }.each do |item| %>
36
<% next if item[:filename].nil? || !item[:filename].end_with?('.md') %>
47
<% @path = item[:filename].split('/')[1..-1].join('/')[0..-4] %>
58
<% @path.chomp!('/index') if @path.end_with?('/index') %>
69
{
710
"title":"<%= clean_for_json(item[:title]) %>",
811
<%# Split off the directory name, join, then remove the '.md' extension %>
9-
"url":"/<%= @path %>/",
12+
"url":"<%= @preface %>/<%= @path %>/",
1013
"body":"<%= clean_for_json(item.compiled_content) %>"
1114
},
1215
<% end %>

‎content/v3/activity/events/types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ Key | Type | Description
496496

497497
##TeamAddEvent
498498

499-
Triggered when a[repository is added to a team](/v3/orgs/teams/#add-team-repository).
499+
Triggered when a[repository is added to a team](/v3/orgs/teams/#add-or-update-team-repository).
500500

501501
Events of this type are not visible in timelines. These events are only used to trigger hooks.
502502

‎content/v3/enterprise.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title:Enterprise
33
---
44

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

77
{:toc}
88

@@ -35,11 +35,11 @@ Every Enterprise API endpoint is only accessible to GitHub Enterprise site admin
3535
[User Administration]:/v3/users/administration/
3636
[Management Console password]:https://help.github.com/enterprise/2.0/admin/articles/accessing-the-management-console/
3737

38-
##PastReleases
38+
##Releases
3939

4040
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

42-
Documentation for the API that's bundled withyour GitHub Enterprise appliance is available forpast releases:
42+
Documentation for the API that's bundled withthe GitHub Enterprise appliance is available forthe following releases:
4343

4444
<% config[:versions][1..-1].each do |version| %>
4545
*[API documentation for <%= version %>](https://developer.github.com/enterprise/<%= version %>/)

‎content/v3/oauth_authorizations.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Make sure you understand how to [work with two-factor authentication](/v3/auth/#
2828
<li><a href="#update-an-existing-authorization">Update an existing authorization</a></li>
2929
</ul>
3030

31+
{% if page.version == 'dotcom' or page.version > 2.2 %}
3132
<p>
3233
To reduce the impact of removing the <code>token</code> value,
3334
the OAuth Authorizations API now includes a new request attribute
@@ -36,7 +37,15 @@ Make sure you understand how to [work with two-factor authentication](/v3/auth/#
3637
<code>fingerprint</code>), and
3738
<a href="#get-or-create-an-authorization-for-a-specific-app-and-fingerprint">one new endpoint</a>.
3839
</p>
39-
40+
{% else %}
41+
<p>
42+
To reduce the impact of removing the <code>token</code> value,
43+
the OAuth Authorizations API now includes a new request attribute
44+
(<code>fingerprint</code>) and three new response attributes
45+
(<code>token_last_eight</code>, <code>hashed_token</code>, and
46+
<code>fingerprint</code>).
47+
</p>
48+
{% endif %}
4049
<p>
4150
This functionality became the default for all requests on April 20, 2015. Please see <a href="/changes/2015-04-20-authorizations-api-response-changes-are-now-in-effect/">the blog post</a> for full details.
4251
</p>

‎content/v3/orgs/hooks.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,21 @@ title: Organization Webhooks
77
{:toc}
88

99
{% if page.version != 'dotcom' and page.version <= 2.2 %}
10+
1011
{{#tip}}
12+
1113
The Organization Webhooks API is currently available for developers to preview.
1214
During the preview period, the API may change without advance notice.
13-
Please see the[blog post](/enterprise/{{ page.version }}/changes/2014-12-03-preview-the-new-organization-webhooks-api/) for full details.
15+
Please see the[blog post](/changes/2014-12-03-preview-the-new-organization-webhooks-api/) for full details.
1416

15-
To access the API during the preview period, you must provide a custom[media type](/enterprise/2.2/v3/media) in the`Accept` header:
17+
To access the API during the preview period, you must provide a custom[media type](/enterprise/{{ page.version }}/v3/media) in the`Accept` header:
1618

1719
```
1820
application/vnd.github.sersi-preview+json
1921
```
22+
2023
{{/tip}}
24+
2125
{% endif %}
2226

2327
Organization webhooks allow you to receive HTTP`POST` payloads whenever certain events happen within the organization. Subscribing to these events makes it possible to build integrations that react to actions on GitHub.com. For more information on actions you can subscribe to, check out our[Events documentation][webhook-events].

‎content/v3/orgs/teams.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -350,14 +350,14 @@ permissions the team grants on it, by passing the following custom
350350
<%= headers 200 %>
351351
<%= json:repo %>
352352

353-
##Add team repository
353+
##Addor updateteam repository
354354

355-
In order to add a repository to a team, the authenticated user must have admin
356-
access totherepository, and mustbe abletoseetheteam. Also, the repository
357-
must beowned bytheorganization, or a direct fork of a repository owned by the
358-
organization.
355+
In order to add a repository to a team or update the team's permission on a
356+
repository,theauthenticated user musthave admin accessto therepository, and
357+
must beable to seetheteam. Also, the repository must be owned by the
358+
organization, or a direct fork of a repository owned by the organization.
359359

360-
PUT /teams/:id/repos/:org/:repo
360+
PUT /teams/:id/repos/:owner/:repo
361361

362362
###Parameters
363363

‎content/v3/versions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ The recommendations below will help you prepare your application for the next ma
143143

144144
1. Team attribute: permission
145145

146-
Recommendation: This attribute no longer dictates the permission a team has on its repositories; it only dictates the default permission that the[Add team repository](/v3/orgs/teams/#add-team-repository) API will use for requests where no`permission` attribute is specified. To change the permission level for every repository on a team, use the[List team repositories](/v3/orgs/teams/#list-team-repos) API to list all of the team's repositories, and then use the[Add team repository](/v3/orgs/teams/#add-team-repository) with a`permission` attribute to update each repository's permission separately.
146+
Recommendation: This attribute no longer dictates the permission a team has on its repositories; it only dictates the default permission that the[Add team repository](/v3/orgs/teams/#add-team-repository) API will use for requests where no`permission` attribute is specified. To change the permission level for every repository on a team, use the[List team repositories](/v3/orgs/teams/#list-team-repos) API to list all of the team's repositories, and then use the[Addor updateteam repository](/v3/orgs/teams/#add-or-update-team-repository) with a`permission` attribute to update each repository's permission separately.
147147

148148
<aid="beta">
149149

‎layouts/head.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
<metahttp-equiv="imagetoolbar"content="false"/>
77
<metaname="MSSmartTagsPreventParsing"content="true"/>
88
<title><%= @item[:title] %> | GitHub Developer Guide</title>
9+
<% if @item[:version] == 'dotcom' %>
910
<linkrel="alternate"type="application/atom+xml"title="API Changes"href="/changes.atom"/>
11+
<% end %>
1012
<linkhref="/assets/stylesheets/application.css"rel="stylesheet"type="text/css"/>
1113
<scriptsrc="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
1214
<scriptsrc="/assets/javascripts/application.js"type="text/javascript"></script>

‎layouts/header.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
<div>
55
<aclass="logo"href="/">GitHub:Developer</a>
66
<ulclass="nav">
7+
<% if @item[:version] != 'dotcom' %>
8+
<li>Enterprise<%= config[:latest_enterprise_version] %></li>
9+
<% end %>
710
<li><ahref="/v3/"class="nav-api">API</a></li>
811
<li><ahref="/program/"class="nav-developers">Developers</a></li>
912
<li><ahref="/changes/"class="nav-blog">Blog</a></li>

‎layouts/sidebar.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ <h3><a href="#" class="js-expand-btn collapsed arrow-btn" data-proofer-ignore></
116116
</ul>
117117
</li>
118118
<liclass="js-topic">
119-
<h3><ahref="#"class="js-expand-btn collapsed arrow-btn"data-proofer-ignore></a><ahref="/v3/enterprise/">Enterprise<%= config[:versions][0] %></a></h3>
119+
<h3><ahref="#"class="js-expand-btn collapsed arrow-btn"data-proofer-ignore></a><ahref="/v3/enterprise/">Enterprise<%= config[:latest_enterprise_version] %></a></h3>
120120
<ulclass="js-guides">
121121
<li><ahref="/v3/enterprise/admin_stats/">Admin Stats</a></li>
122122
<li><ahref="/v3/enterprise/ldap/">LDAP</a></li>

‎nanoc.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ data_variables:
2626
path:""
2727
values:
2828
version:"dotcom"
29+
-
30+
scope:
31+
path:"enterprise-(?!backports)"
32+
values:
33+
version:*latest_enterprise_version
2934

3035
page_variables:
3136
-
@@ -45,6 +50,12 @@ page_variables:
4550
# exclude integrations-directory from search
4651
values:
4752
hide_from_search:true
53+
-
54+
scope:
55+
path:"enterprise"
56+
values:
57+
version:*latest_enterprise_version
58+
is_enterprise_help:"true"
4859

4960
# For the atom feed.
5061
base_url:http://developer.github.com

‎script/enterprise-backport

Lines changed: 112 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,126 @@
11
#!/usr/bin/env ruby
22

3-
# Occasionally, a change made to the latest version of the Enterprise API documentation
4-
# will need to be backported to the previous verison. This script takes the latest content
5-
# for /enterprise and moves it into the appropriate version folder.
3+
require'bundler/setup'
4+
require'fileutils'
65

7-
require'tmpdir'
6+
require'nanoc'
7+
require'yaml'
8+
require'json'
9+
require'active_support/core_ext/hash'
810

9-
ifARGV.length !=1
10-
error='''Error: Run the script like this: bundle exec script/enterprise-backport [VERSION]
11-
e.g. bundle exec script/enterprise-backport 2.0
12-
'''
13-
aborterror
11+
Dir.glob('tasks/*.rake').each{ |r|loadr}
12+
13+
start_message
14+
15+
#################################################################
16+
## Phase 1: Build the versioned content ##
17+
#################################################################
18+
19+
defbuild_the_versioned_content
20+
config=YAML.load_file('nanoc.yaml')
21+
22+
# set page.version for every article to <CURR_VERSION>
23+
defaults=config['page_variables']
24+
defaults.first['values']['version']=CURR_VERSION
25+
26+
yaml="""
27+
is_enterprise_help: true
28+
audience:#{CURR_VERSION}
29+
version:#{CURR_VERSION}
30+
latest_enterprise_version: &latest_enterprise_version#{CURR_VERSION}
31+
data_variables:
32+
-
33+
scope:
34+
path: ''
35+
values:
36+
version:#{CURR_VERSION}
37+
"""
38+
39+
config_enterprise_admin=Tempfile.new('_config.enterprise.yml')
40+
config_enterprise_admin.write(yaml.strip)
41+
config_enterprise_admin.rewind
42+
config_enterprise_admin.close
43+
44+
config_enterprise_admin=YAML.load_file(config_enterprise_admin.path)
45+
46+
versioned_config=symbolize_hash(config.deep_merge(config_enterprise_admin))
47+
48+
ent_scope_idx=versioned_config[:page_variables].find_index{ |v|v[:scope][:path] =='enterprise'}
49+
50+
versioned_config[:page_variables][ent_scope_idx][:values][:version]=CURR_VERSION
51+
52+
Nanoc::Int::SiteLoader.new.new_with_config(versioned_config).compile
53+
54+
puts`node_modules/gulp/bin/gulp.js assets`
55+
failunless $CHILD_STATUS.to_i ==0
56+
57+
versioned_config
1458
end
1559

16-
VERSION=ARGV[0].dup# like, 11.10.340
60+
#################################################################
61+
## Phase 2: Rewrite the generated content ##
62+
#################################################################
1763

18-
BRANCH_NAME="backport-docs-for-#{VERSION}"
64+
defrewrite_generated_content
65+
Dir.glob('output/**/*.html')do |f|
66+
doc=Nokogiri::HTML.parse(File.read(f))
67+
doc=rewrite_asset_paths(doc)
68+
doc=rewrite_anchors(doc)
69+
html=doc.to_html.to_s
70+
html=rewrite_whitespace(html)
71+
File.write(f,html)
72+
end
1973

20-
Dir.glob('tasks/*.rake').each{ |r|loadr}
74+
Dir.glob('output/**/*.css')do |css_path|
75+
rewrite_octicons_path(css_path)
76+
end
2177

22-
setup
78+
search_json=File.read('output/search/search-index.json')
79+
search_json=rewrite_whitespace(search_json)
80+
File.write('output/search/search-index.json',search_json)
81+
end
82+
83+
#################################################################
84+
## Phase 3: Remove non-existent content ##
85+
#################################################################
86+
87+
defremove_nonexistent_content
88+
# find all the valid files based on the sidebar links
89+
v3_api_sidebar=File.open("#{VERSIONED_ENT_PATH}/v3/index.html"){ |f|Nokogiri::XML(f)}
90+
pages=[]
91+
v3_api_sidebar.css('#js-sidebar a').eachdo |a|
92+
href=a['href']
93+
nextifhref =='#' || !href.start_with?("/#{VERSIONED_ENT_PATH}/v3")
94+
pages <<href
95+
end
2396

24-
temp_dir=Dir.mktmpdir
25-
begin
26-
`cp -r v3/enterprise enterprise/#{VERSION}/v3/`
97+
# remove non-existent files from search index
98+
search_json_path="#{VERSIONED_ENT_PATH}/search/search-index.json"
99+
search_json=JSON.parse(File.read(search_json_path))
100+
kept_json=[]
101+
removed_files=[]
27102

28-
rewrite_content("enterprise/#{VERSION}/v3/enterprise")
103+
search_json.eachdo |e|
104+
url=e['url']
105+
nextifurl.nil?
106+
ifpages.include?(url) ||url !~%r{^/#{VERSIONED_ENT_PATH}/v3/}
107+
kept_json <<e
108+
else
109+
removed_files <<url[1..-1]# trim starting "/"
110+
end
111+
end
29112

30-
`git add enterprise`
31-
`git commit -m "Added enterprise-#{VERSION} backported files"`
32-
ensure
33-
FileUtils.remove_entry_securetemp_dir
113+
File.write(search_json_path,JSON.pretty_generate(kept_json))
114+
115+
# remove non-existent files from disk
116+
removed_files.each{ |f|FileUtils.rm_rf(f)}
34117
end
35118

36-
puts"\n\nOkay! Feel free to `git push#{BRANCH_NAME}` if you like."
119+
prepare
120+
build_the_versioned_content
121+
rewrite_generated_content
122+
copy_to_destination
123+
remove_nonexistent_content
124+
cleanup
125+
126+
puts'All done!'

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp