Skip to content
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
3 changes: 0 additions & 3 deletions app/public/theme-settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@
},
"features": {
"docs": {
"summary": {
"hide": false
},
"navigator": {
"enable": false
}
Expand Down
23 changes: 9 additions & 14 deletions src/components/DocumentationTopic.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!--
This source file is part of the Swift.org open source project

Copyright (c) 2021 Apple Inc. and the Swift project authors
Copyright (c) 2022 Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception

See https://swift.org/LICENSE.txt for license information
Expand All @@ -13,6 +13,12 @@
<main class="main" id="main" role="main" tabindex="0">
<DocumentationHero :type="symbolKind || role" :enhanceBackground="enhanceBackground">
<slot name="above-title" />
<LanguageSwitcher
v-if="shouldShowLanguageSwitcher"
:interfaceLanguage="interfaceLanguage"
:objcPath="objcPath"
:swiftPath="swiftPath"
/>
<Title :eyebrow="roleHeading">{{ title }}</Title>
<Abstract v-if="abstract" :content="abstract" />
<div v-if="sampleCodeDownload">
Expand All @@ -23,14 +29,6 @@
:platforms="platforms" :technologies="technologies"
/>
</DocumentationHero>
<Summary v-if="!hideSummary && shouldShowLanguageSwitcher">
<LanguageSwitcher
v-if="shouldShowLanguageSwitcher"
:interfaceLanguage="interfaceLanguage"
:objcPath="objcPath"
:swiftPath="swiftPath"
/>
</Summary>
<div class="container">
<Description :hasOverview="hasOverview">
<RequirementMetadata
Expand Down Expand Up @@ -81,7 +79,6 @@
<script>
import Language from 'docc-render/constants/Language';
import metadata from 'docc-render/mixins/metadata';
import { getSetting } from 'docc-render/utils/theme-settings';

import Aside from 'docc-render/components/ContentNode/Aside.vue';
import BetaLegalText from 'theme/components/DocumentationTopic/BetaLegalText.vue';
Expand All @@ -97,7 +94,6 @@ import Relationships from './DocumentationTopic/Relationships.vue';
import RequirementMetadata from './DocumentationTopic/Description/RequirementMetadata.vue';
import Availability from './DocumentationTopic/Summary/Availability.vue';
import SeeAlso from './DocumentationTopic/SeeAlso.vue';
import Summary from './DocumentationTopic/Summary.vue';
import Title from './DocumentationTopic/Title.vue';
import Topics from './DocumentationTopic/Topics.vue';

Expand Down Expand Up @@ -134,7 +130,6 @@ export default {
RequirementMetadata,
Availability,
SeeAlso,
Summary,
Title,
Topics,
},
Expand Down Expand Up @@ -290,8 +285,8 @@ export default {
pageDescription: ({ abstract, extractFirstParagraphText }) => (
abstract ? extractFirstParagraphText(abstract) : null
),
shouldShowLanguageSwitcher: ({ objcPath, swiftPath }) => objcPath && swiftPath,
hideSummary: () => getSetting(['features', 'docs', 'summary', 'hide'], false),
shouldShowLanguageSwitcher:
({ objcPath, swiftPath, isTargetIDE }) => objcPath && swiftPath && isTargetIDE,
enhanceBackground: ({ symbolKind }) => (symbolKind ? (symbolKind === 'module') : true),
technologies({ modules = [] }) {
const technologyList = modules.reduce((list, module) => {
Expand Down
4 changes: 0 additions & 4 deletions src/components/DocumentationTopic/DocumentationHero.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,6 @@ $doc-hero-icon-color: dark-color(fill-secondary) !default;
padding-bottom: 40px;
position: relative;

@include breakpoint(small) {
text-align: center;
}

// gradient
&:before {
content: '';
Expand Down
50 changes: 49 additions & 1 deletion src/components/DocumentationTopic/DocumentationNav.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!--
This source file is part of the Swift.org open source project

Copyright (c) 2021 Apple Inc. and the Swift project authors
Copyright (c) 2022 Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception

See https://swift.org/LICENSE.txt for license information
Expand Down Expand Up @@ -49,6 +49,18 @@
:currentTopicTags="currentTopicTags"
:references="references"
/>
<NavMenuItems
class="nav-menu-settings"
:previousSiblingChildren="breadcrumbCount"
>
<LanguageToggle
v-if="interfaceLanguage && (swiftPath || objcPath)"
:interfaceLanguage="interfaceLanguage"
:objcPath="objcPath"
:swiftPath="swiftPath"
/>
<slot name="menu-items" />
</NavMenuItems>
<slot name="tray-after" v-bind="{ breadcrumbCount }" />
</template>
<template slot="after-content">
Expand All @@ -59,16 +71,20 @@

<script>
import NavBase from 'docc-render/components/NavBase.vue';
import NavMenuItems from 'docc-render/components/NavMenuItems.vue';
import { BreakpointName } from 'docc-render/utils/breakpoints';
import SidenavIcon from 'theme/components/Icons/SidenavIcon.vue';
import Hierarchy from './DocumentationNav/Hierarchy.vue';
import LanguageToggle from './DocumentationNav/LanguageToggle.vue';

export default {
name: 'DocumentationNav',
components: {
SidenavIcon,
NavBase,
NavMenuItems,
Hierarchy,
LanguageToggle,
},
props: {
title: {
Expand Down Expand Up @@ -107,6 +123,18 @@ export default {
type: Boolean,
default: true,
},
interfaceLanguage: {
type: String,
required: false,
},
objcPath: {
type: String,
required: false,
},
swiftPath: {
type: String,
required: false,
},
},
computed: {
BreakpointName: () => BreakpointName,
Expand Down Expand Up @@ -164,6 +192,26 @@ $sidenav-icon-size: 19px;
@include font-styles(documentation-nav);
// vertically align the items
padding-top: 0;

&-settings {
@include font-styles(nav-toggles);

@include breakpoint-only-largenav() {
margin-left: $nav-space-between-elements;
}

@include nav-in-breakpoint {
padding-top: 0;

&:not([data-previous-menu-children-count="0"]) {
.nav-menu-setting:first-child {
border-top: 1px solid dark-color(figure-gray-tertiary);
display: flex;
align-items: center;
}
}
}
}
}

.documentation-nav {
Expand Down
Loading