vault backup: 2026-05-30 19:03:22

This commit is contained in:
Dmitry
2026-05-30 19:03:22 +03:00
parent a54f2b19c3
commit 7a4f2ced46
16 changed files with 1986 additions and 19 deletions
+2 -1
View File
@@ -18,5 +18,6 @@
"obsidian-git", "obsidian-git",
"obsidian-transcription", "obsidian-transcription",
"obsidian-excalidraw-plugin", "obsidian-excalidraw-plugin",
"terminal" "terminal",
"pdf-plus"
] ]
+1 -1
View File
@@ -29,5 +29,5 @@
"publish": false, "publish": false,
"sync": false, "sync": false,
"bases": true, "bases": true,
"webviewer": true "webviewer": false
} }
+326
View File
@@ -0,0 +1,326 @@
{
"displayTextFormats": [
{
"name": "Title & page",
"template": "{{file.basename}}, p.{{pageLabel}}"
},
{
"name": "Page",
"template": "p.{{pageLabel}}"
},
{
"name": "Text",
"template": "{{text}}"
},
{
"name": "Emoji",
"template": "📖"
},
{
"name": "None",
"template": ""
}
],
"defaultDisplayTextFormatIndex": 0,
"syncDisplayTextFormat": true,
"syncDefaultDisplayTextFormat": false,
"copyCommands": [
{
"name": "Quote",
"template": "> ({{linkWithDisplay}})\n> {{text}}\n"
},
{
"name": "Link",
"template": "{{linkWithDisplay}}"
},
{
"name": "Embed",
"template": "!{{link}}"
},
{
"name": "Callout",
"template": "> [!{{calloutType}}|{{color}}] {{linkWithDisplay}}\n> {{text}}\n"
},
{
"name": "Quote in callout",
"template": "> [!{{calloutType}}|{{color}}] {{linkWithDisplay}}\n> > {{text}}\n> \n> "
}
],
"useAnotherCopyTemplateWhenNoSelection": false,
"copyTemplateWhenNoSelection": "{{linkToPageWithDisplay}}",
"trimSelectionEmbed": false,
"embedMargin": 50,
"noSidebarInEmbed": true,
"noSpreadModeInEmbed": true,
"embedUnscrollable": false,
"singleTabForSinglePDF": true,
"highlightExistingTab": false,
"existingTabHighlightOpacity": 0.5,
"existingTabHighlightDuration": 0.75,
"paneTypeForFirstPDFLeaf": "left",
"openLinkNextToExistingPDFTab": true,
"openPDFWithDefaultApp": false,
"openPDFWithDefaultAppAndObsidian": true,
"focusObsidianAfterOpenPDFWithDefaultApp": true,
"syncWithDefaultApp": false,
"dontActivateAfterOpenPDF": true,
"dontActivateAfterOpenMD": true,
"highlightDuration": 0.75,
"noTextHighlightsInEmbed": false,
"noAnnotationHighlightsInEmbed": true,
"persistentTextHighlightsInEmbed": true,
"persistentAnnotationHighlightsInEmbed": false,
"highlightBacklinks": true,
"selectionBacklinkVisualizeStyle": "highlight",
"dblclickEmbedToOpenLink": true,
"highlightBacklinksPane": true,
"highlightOnHoverBacklinkPane": true,
"backlinkHoverColor": "",
"colors": {
"Yellow": "#ffd000",
"Red": "#ea5252",
"Note": "#086ddd",
"Important": "#bb61e5"
},
"defaultColor": "",
"defaultColorPaletteItemIndex": 0,
"syncColorPaletteItem": true,
"syncDefaultColorPaletteItem": false,
"colorPaletteInToolbar": true,
"noColorButtonInColorPalette": true,
"colorPaletteInEmbedToolbar": false,
"quietColorPaletteTooltip": false,
"showStatusInToolbar": true,
"highlightColorSpecifiedOnly": false,
"doubleClickHighlightToOpenBacklink": true,
"hoverHighlightAction": "preview",
"paneTypeForFirstMDLeaf": "right",
"singleMDLeafInSidebar": true,
"alwaysUseSidebar": true,
"ignoreExistingMarkdownTabIn": [],
"defaultColorPaletteActionIndex": 4,
"syncColorPaletteAction": true,
"syncDefaultColorPaletteAction": false,
"proxyMDProperty": "PDF",
"hoverPDFLinkToOpen": false,
"ignoreHeightParamInPopoverPreview": true,
"filterBacklinksByPageDefault": true,
"showBacklinkToPage": true,
"enableHoverPDFInternalLink": true,
"recordPDFInternalLinkHistory": true,
"alwaysRecordHistory": true,
"renderMarkdownInStickyNote": false,
"enablePDFEdit": false,
"author": "",
"writeHighlightToFileOpacity": 0.2,
"defaultWriteFileToggle": false,
"syncWriteFileToggle": true,
"syncDefaultWriteFileToggle": false,
"enableAnnotationDeletion": true,
"warnEveryAnnotationDelete": false,
"warnBacklinkedAnnotationDelete": true,
"enableAnnotationContentEdit": true,
"enableEditEncryptedPDF": false,
"pdfLinkColor": "#04a802",
"pdfLinkBorder": false,
"replaceContextMenu": true,
"showContextMenuOnMouseUpIf": "Mod",
"contextMenuConfig": [
{
"id": "action",
"visible": true
},
{
"id": "selection",
"visible": true
},
{
"id": "write-file",
"visible": true
},
{
"id": "annotation",
"visible": true
},
{
"id": "modify-annotation",
"visible": true
},
{
"id": "link",
"visible": true
},
{
"id": "text",
"visible": true
},
{
"id": "search",
"visible": true
},
{
"id": "speech",
"visible": true
},
{
"id": "page",
"visible": true
},
{
"id": "settings",
"visible": true
}
],
"selectionProductMenuConfig": [
"color",
"copy-format",
"display"
],
"writeFileProductMenuConfig": [
"color",
"copy-format",
"display"
],
"annotationProductMenuConfig": [
"copy-format",
"display"
],
"updateColorPaletteStateFromContextMenu": true,
"mobileCopyAction": "pdf-plus",
"showContextMenuOnTablet": false,
"executeBuiltinCommandForOutline": true,
"executeBuiltinCommandForZoom": true,
"executeFontSizeAdjusterCommand": true,
"closeSidebarWithShowCommandIfExist": true,
"autoHidePDFSidebar": false,
"defaultSidebarView": 1,
"outlineDrag": true,
"outlineContextMenu": true,
"outlineLinkDisplayTextFormat": "{{file.basename}}, {{text}}",
"outlineLinkCopyFormat": "{{linkWithDisplay}}",
"recordHistoryOnOutlineClick": true,
"popoverPreviewOnOutlineHover": true,
"thumbnailDrag": true,
"thumbnailContextMenu": true,
"thumbnailLinkDisplayTextFormat": "{{file.basename}}, p.{{pageLabel}}",
"thumbnailLinkCopyFormat": "{{linkWithDisplay}}",
"recordHistoryOnThumbnailClick": true,
"popoverPreviewOnThumbnailHover": true,
"annotationPopupDrag": true,
"showAnnotationPopupOnHover": true,
"useCallout": true,
"calloutType": "PDF",
"calloutIcon": "highlighter",
"highlightBacklinksInEmbed": false,
"highlightBacklinksInHoverPopover": false,
"highlightBacklinksInCanvas": true,
"clickPDFInternalLinkWithModifierKey": true,
"clickOutlineItemWithModifierKey": true,
"clickThumbnailWithModifierKey": true,
"focusEditorAfterAutoPaste": true,
"clearSelectionAfterAutoPaste": true,
"respectCursorPositionWhenAutoPaste": true,
"blankLineAboveAppendedContent": true,
"autoCopy": false,
"autoFocus": false,
"autoPaste": false,
"autoFocusTarget": "last-active-and-open-then-last-paste",
"autoPasteTarget": "last-active-and-open-then-last-paste",
"openAutoFocusTargetIfNotOpened": true,
"howToOpenAutoFocusTargetIfNotOpened": "right",
"closeHoverEditorWhenLostFocus": true,
"closeSidebarWhenLostFocus": false,
"openAutoFocusTargetInEditingView": true,
"executeCommandWhenTargetNotIdentified": true,
"commandToExecuteWhenTargetNotIdentified": "switcher:open",
"autoPasteTargetDialogTimeoutSec": 20,
"autoCopyToggleRibbonIcon": true,
"autoCopyIconName": "highlighter",
"autoFocusToggleRibbonIcon": true,
"autoFocusIconName": "zap",
"autoPasteToggleRibbonIcon": true,
"autoPasteIconName": "clipboard-paste",
"viewSyncFollowPageNumber": true,
"viewSyncPageDebounceInterval": 0.3,
"openAfterExtractPages": true,
"howToOpenExtractedPDF": "tab",
"warnEveryPageDelete": false,
"warnBacklinkedPageDelete": true,
"extractPageInPlace": false,
"askExtractPageInPlace": true,
"pageLabelUpdateWhenInsertPage": "keep",
"pageLabelUpdateWhenDeletePage": "keep",
"pageLabelUpdateWhenExtractPage": "keep",
"askPageLabelUpdateWhenInsertPage": true,
"askPageLabelUpdateWhenDeletePage": true,
"askPageLabelUpdateWhenExtractPage": true,
"copyOutlineAsListFormat": "{{linkWithDisplay}}",
"copyOutlineAsListDisplayTextFormat": "{{text}}",
"copyOutlineAsHeadingsFormat": "{{text}}\n\n{{linkWithDisplay}}",
"copyOutlineAsHeadingsDisplayTextFormat": "p.{{pageLabel}}",
"copyOutlineAsHeadingsMinLevel": 2,
"newFileNameFormat": "",
"newFileTemplatePath": "",
"newPDFLocation": "current",
"newPDFFolderPath": "",
"rectEmbedStaticImage": false,
"rectImageFormat": "file",
"rectImageExtension": "webp",
"zoomToFitRect": false,
"rectFollowAdaptToTheme": true,
"rectEmbedResolution": 100,
"includeColorWhenCopyingRectLink": true,
"backlinkIconSize": 50,
"showBacklinkIconForSelection": false,
"showBacklinkIconForAnnotation": false,
"showBacklinkIconForOffset": true,
"showBacklinkIconForRect": false,
"showBoundingRectForBacklinkedAnnot": false,
"hideReplyAnnotation": false,
"hideStampAnnotation": false,
"searchLinkHighlightAll": "true",
"searchLinkCaseSensitive": "true",
"searchLinkMatchDiacritics": "default",
"searchLinkEntireWord": "false",
"dontFitWidthWhenOpenPDFLink": true,
"preserveCurrentLeftOffsetWhenOpenPDFLink": false,
"defaultZoomValue": "page-width",
"scrollModeOnLoad": 0,
"spreadModeOnLoad": 0,
"usePageUpAndPageDown": true,
"hoverableDropdownMenuInToolbar": true,
"zoomLevelInputBoxInToolbar": true,
"popoverPreviewOnExternalLinkHover": true,
"actionOnCitationHover": "pdf-plus-bib-popover",
"enableBibInEmbed": false,
"enableBibInHoverPopover": false,
"enableBibInCanvas": true,
"citationIdPatterns": "^cite.\n^bib\\d+$",
"copyAsSingleLine": true,
"removeWhitespaceBetweenCJChars": true,
"dummyFileFolderPath": "",
"externalURIPatterns": [
".*\\.pdf$",
"https://arxiv.org/pdf/.*"
],
"modifierToDropExternalPDFToCreateDummy": [
"Shift"
],
"vim": false,
"vimrcPath": "",
"vimVisualMotion": true,
"vimScrollSize": 40,
"vimLargerScrollSizeWhenZoomIn": true,
"vimContinuousScrollSpeed": 1.2,
"vimSmoothScroll": true,
"vimHlsearch": true,
"vimIncsearch": true,
"enableVimInContextMenu": true,
"enableVimOutlineMode": true,
"vimSmoothOutlineMode": true,
"vimHintChars": "hjklasdfgyuiopqwertnmzxcvb",
"vimHintArgs": "all",
"PATH": "",
"autoCheckForUpdates": true,
"fixObsidianTextSelectionBug": true
}
File diff suppressed because one or more lines are too long
+15
View File
@@ -0,0 +1,15 @@
{
"id": "pdf-plus",
"name": "PDF++",
"version": "0.40.31",
"minAppVersion": "1.5.8",
"description": "The most Obsidian-native PDF annotation tool ever.",
"author": "Ryota Ushio",
"authorUrl": "https://github.com/RyotaUshio",
"fundingUrl": {
"GitHub Sponsor": "https://github.com/sponsors/RyotaUshio",
"Buy Me a Coffee": "https://www.buymeacoffee.com/ryotaushio",
"Ko-fi": "https://ko-fi.com/ryotaushio"
},
"isDesktopOnly": false
}
+694
View File
@@ -0,0 +1,694 @@
/* @settings
name: PDF++
id: pdf-plus
settings:
-
id: pdf-highlight
title: Highlights
type: heading
level: 2
-
id: pdf-plus-highlight-opacity
title: Highlight opacity
type: variable-number-slider
min: 0
max: 1
step: 0.01
default: 0.2
-
id: pdf-plus-highlight-padding-vertical-em
title: Highlight padding (top & bottom)
description: Boldness of highlights (em)
type: variable-number-slider
min: 0
max: 1
step: 0.01
default: 0.05
format: em
-
id: pdf-plus-highlight-padding-horizontal-em
title: Highlight padding (left & right)
description: Boldness of highlights (em)
type: variable-number-slider
min: 0
max: 1
step: 0.01
default: 0.05
format: em
-
id: pdf-plus-highlight-border-radius
title: Highlight edge roundness
description: Radius of the highlight edge (em). 0 for sharp edges and 0.5 for rounded edges.
type: variable-number-slider
min: 0
max: 0.5
step: 0.01
default: 0.1
format: em
-
id: pdf-rect
title: Rectanglular selection
type: heading
level: 2
-
id: pdf-plus-rect-highlight-opacity
title: Rectangle highlight opacity
type: variable-number-slider
min: 0
max: 1
step: 0.01
default: 1
-
id: pdf-plus-rect-highlight-border-width
title: Rectangle highlight border width (px)
type: variable-number-slider
min: 1
max: 10
step: 1
default: 2
format: px
-
id: hover-popover
title: Hover popovers
type: heading
level: 2
-
id: pdf-plus-backlink-popover
title: Backlink popovers
description: Styles for popovers displayed when hovering over backlinked highlights or rectangular selections in PDF viewer
type: heading
level: 3
-
id: pdf-plus-backlink-popover-width
title: Backlink popover width (px)
type: variable-number-slider
min: 100
max: 1000
step: 10
default: 450
format: px
-
id: pdf-plus-backlink-popover-height
title: Backlink popover height (px)
type: variable-number-slider
min: 100
max: 1000
step: 10
default: 400
format: px
-
id: pdf-plus-pdf-link-like-popover
title: PDF internal link popovers
description: Styles for popovers displayed when hovering over internal links, outline items or thumbnails in PDF viewer
type: heading
level: 3
-
id: pdf-plus-pdf-link-like-popover-width
title: PDF internal link popover width (px)
type: variable-number-slider
min: 100
max: 1000
step: 10
default: 450
format: px
-
id: pdf-plus-pdf-link-like-popover-height
title: PDF internal link popover height (px)
type: variable-number-slider
min: 100
max: 1000
step: 10
default: 400
format: px
-
id: pdf-toolbar
title: PDF toolbars
type: heading
level: 2
-
id: hide-pdf-embed-toolbar
title: Hide toolbar in PDF embeds with a page specified
type: class-toggle
default: true
-
id: hide-pdf-toolbar-in-hover-editor
title: Hide PDF toolbar in Hover Editor
type: class-toggle
default: true
-
id: pdf-sidebar
title: PDF sidebars
type: heading
level: 2
-
id: pdf-plus-sidebar-width
title: Sidebar width (px)
type: variable-number-slider
min: 100
max: 1000
step: 10
default: 140
format: px
-
id: pdf-plus-vim
title: Vim keybindings
type: heading
level: 2
-
id: pdf-plus-vim-hin
title: Hint mode
type: heading
level: 3
-
id: pdf-plus-vim-hint-inverted
title: Inverted color scheme
type: class-toggle
default: false
*/
:root {
--pdf-plus-highlight-padding-default-em: 0.05em;
}
.hide-pdf-embed-toolbar .pdf-embed[src*="#"] .pdf-toolbar,
.hide-pdf-embed-toolbar .popover.hover-popover.hover-editor .pdf-embed[src*="#"] .pdf-toolbar {
display: none;
}
.hide-pdf-toolbar-in-hover-editor .popover.hover-popover.hover-editor .view-content>.pdf-toolbar {
display: none !important;
}
/* When hovering over a highlighted text in PDF viewer, highlight the corresponding item in backlink pane */
.backlink-pane .search-result-file-match.hovered-backlink,
.backlink-pane .search-result-file-matches:has(.better-search-views-tree) .better-search-views-file-match.hovered-backlink:not(:hover) {
background-color: var(--text-selection);
}
.setting-item.no-border,
.pdf-plus-settings.vertical-tab-content .setting-item.no-border {
border-top: none;
&.small-padding {
padding-top: 0;
}
}
.setting-item-control input.error {
border-color: var(--background-modifier-error);
}
.setting-item-description.error {
color: var(--background-modifier-error);
}
.is-mobile,
.is-tablet {
.pdf-plus-color-palette .pdf-plus-color-palette-item-inner {
width: calc(var(--swatch-width) * 0.85);
height: calc(var(--swatch-width) * 0.85);
}
}
.pdf-plus-color-palette {
user-select: none;
-webkit-user-select: none;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
.pdf-plus-color-palette-item {
/* Avoid text selections to be cleared when tapping on a color palette item on the mobile app */
/* https://github.com/RyotaUshio/obsidian-pdf-plus/issues/169 */
user-select: none;
.pdf-plus-color-palette-item-inner {
width: var(--swatch-width);
height: var(--swatch-width);
border-radius: 50%;
border: var(--input-border-width) solid var(--background-modifier-border);
}
}
.pdf-plus-color-palette-status-container {
padding: var(--size-2-2) var(--size-2-3);
color: var(--text-muted);
font-size: var(--font-ui-small);
text-wrap: nowrap;
}
}
.menu .menu-item.pdf-plus-color-menu-item {
padding-left: 0;
.pdf-plus-color-indicator {
border-radius: 50%;
border-width: 0;
height: var(--size-4-3);
width: var(--size-4-3);
}
}
.pdf-toolbar .clickable-icon.is-disabled {
background-color: inherit;
&>svg {
color: var(--text-faint);
}
}
/* .pdf-page-input, */
.pdf-zoom-level-input {
width: 6ch;
text-align: right;
font-variant-numeric: tabular-nums;
}
.pdf-zoom-level-percent {
white-space: nowrap;
margin-right: var(--size-4-1);
font-size: var(--font-ui-small);
font-variant-numeric: tabular-nums;
}
.pdf-plus-settings.vertical-tab-content {
--pdf-plus-settings-header-height: var(--size-4-12);
padding-top: 0;
padding-left: 0;
padding-right: 0;
}
.pdf-plus-settings.vertical-tab-content .header-container {
position: sticky;
top: 0;
z-index: 10;
height: var(--pdf-plus-settings-header-height);
line-height: var(--pdf-plus-settings-header-height);
text-align: center;
background-color: var(--background-secondary);
border-bottom: 1px solid var(--divider-color);
padding: 0 var(--size-4-4);
overflow-x: scroll;
overflow-y: hidden;
white-space: nowrap;
display: flex;
justify-content: space-between;
align-items: center;
.header {
line-height: normal;
.header-title {
display: none;
}
}
}
.pdf-plus-settings.vertical-tab-content .content {
padding-top: var(--size-4-8);
padding-bottom: var(--size-4-16);
padding-left: var(--size-4-12);
padding-right: var(--size-4-12);
}
.pdf-plus-settings.vertical-tab-content .spacer {
height: var(--pdf-plus-settings-header-height);
}
.pdf-plus-settings.vertical-tab-content .top-note {
min-height: var(--pdf-plus-settings-header-height);
color: var(--text-muted);
font-size: var(--font-ui-smaller);
}
.pdf-plus-settings .setting-item-description,
.pdf-plus-modal .setting-item-description {
&>p:first-child {
margin-top: 0;
}
&>p:last-child {
margin-bottom: 0;
}
}
.pdf-plus-settings .ignore-split-setting.setting-item {
padding-top: 0;
}
.annotationLayer .popupContent {
&>p:first-child {
margin-top: 0;
}
&>p:last-child {
margin-bottom: 0;
}
}
.pdf-plus-backlink-highlight-layer {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 2;
transform-origin: 0 0;
pointer-events: none;
}
.pdf-plus-backlink-highlight-layer .pdf-plus-backlink {
position: absolute;
pointer-events: auto;
}
.pdf-plus-backlink-highlight-layer .pdf-plus-backlink.pdf-plus-backlink-selection {
box-sizing: content-box;
cursor: text;
}
.pdf-plus-backlink-highlight-layer .rect-highlight {
background-color: rgb(var(--text-highlight-bg-rgb));
border-radius: var(--radius-m);
opacity: 0.2;
}
body:not(.pdf-plus-backlink-selection-underline) .pdf-plus-backlink-highlight-layer .pdf-plus-backlink.pdf-plus-backlink-selection {
background-color: rgb(from var(--pdf-plus-color) r g b / var(--pdf-plus-highlight-opacity, 0.2));
padding: var(--pdf-plus-highlight-padding-vertical-em, var(--pdf-plus-highlight-padding-default-em)) var(--pdf-plus-highlight-padding-horizontal-em, var(--pdf-plus-highlight-padding-default-em));
margin: calc(var(--pdf-plus-highlight-padding-vertical-em, var(--pdf-plus-highlight-padding-default-em)) * -1) calc(var(--pdf-plus-highlight-padding-horizontal-em, var(--pdf-plus-highlight-padding-default-em)) * -1);
border-radius: var(--pdf-plus-highlight-border-radius, 0.1em);
}
body.pdf-plus-backlink-selection-underline {
.pdf-plus-backlink-highlight-layer .pdf-plus-backlink.pdf-plus-backlink-selection {
padding: 0;
margin: 0;
opacity: 1.0;
border-radius: 0;
}
.pdf-plus-backlink-highlight-layer[data-main-rotation="0"] .pdf-plus-backlink.pdf-plus-backlink-selection {
border-bottom: 0.1em solid var(--pdf-plus-color);
}
.pdf-plus-backlink-highlight-layer[data-main-rotation="90"] .pdf-plus-backlink.pdf-plus-backlink-selection {
border-right: 0.1em solid var(--pdf-plus-color);
}
.pdf-plus-backlink-highlight-layer[data-main-rotation="180"] .pdf-plus-backlink.pdf-plus-backlink-selection {
border-top: 0.1em solid var(--pdf-plus-color);
}
.pdf-plus-backlink-highlight-layer[data-main-rotation="270"] .pdf-plus-backlink.pdf-plus-backlink-selection {
border-left: 0.1em solid var(--pdf-plus-color);
}
}
.pdf-plus-backlink-highlight-layer .pdf-plus-backlink.pdf-plus-backlink-fit-r {
border: dashed rgb(from var(--pdf-plus-rect-color) r g b / var(--pdf-plus-rect-highlight-opacity, 1)) var(--pdf-plus-rect-highlight-border-width, 2px);
}
.pdf-plus-backlink-icon {
position: absolute;
--icon-size: 100%;
}
[data-main-rotation="90"] .pdf-plus-backlink-icon {
transform: rotate(270deg);
}
[data-main-rotation="180"] .pdf-plus-backlink-icon {
transform: rotate(180deg);
}
[data-main-rotation="270"] .pdf-plus-backlink-icon {
transform: rotate(90deg);
}
.pdf-plus-annotation-edit-modal {
.desc {
margin-bottom: var(--size-4-4);
}
.preview-container {
background: var(--background-modifier-form-field);
border: var(--input-border-width) solid var(--background-modifier-border);
border-radius: var(--input-radius);
padding: var(--size-4-1) var(--size-4-2);
text-align: left;
&>p:first-child {
margin-top: 0;
}
&>p:last-child {
margin-bottom: 0;
}
}
/* Arrange two children of .setting-item, namely .setting-item-info and .setting-item-contrl, vertically */
.setting-item:last-child:has(textarea) {
display: flex;
flex-direction: column;
justify-content: left;
align-items: flex-start;
.setting-item-control {
width: 100%;
padding-top: var(--size-4-2);
}
}
.pdf-plus-annotation-edit-modal-save-instructions {
color: var(--text-muted);
font-size: calc(var(--font-text-size) * 0.65);
text-align: end;
}
}
.popupWrapper {
--pdf-popup-width: 310px;
}
.pdf-plus-annotation-icon-container {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
margin-right: calc(var(--size-4-1) * -1);
margin-left: calc(var(--size-2-1) * -1);
.clickable-icon {
margin-right: 0;
margin-left: 0;
}
}
.pdf-plus-draggable .popup {
cursor: default;
}
#pdf-plus-funding {
display: flex;
flex-direction: column;
justify-content: left;
align-items: flex-end;
.setting-item-control {
padding-top: var(--size-4-4);
}
}
#pdf-plus-funding-icon-info-container {
display: flex;
flex-direction: row;
/* justify-content: left; */
align-items: center;
}
#pdf-plus-funding-icon {
margin-right: var(--size-4-4);
}
.page-label-range:first-of-type {
margin-top: var(--size-4-4);
}
.page-label-range:not(:first-of-type) {
margin-top: var(--size-4-9);
}
.pdf-plus-page-label-modal {
z-index: var(--he-popover-layer-inactive, var(--layer-popover));
.page-labels-loading {
color: var(--text-muted);
text-align: center;
margin: var(--size-4-4);
}
}
.pdf-plus-restore-default-modal {
user-select: text;
}
.pdf-content-container {
--sidebar-width: var(--pdf-plus-sidebar-width, 140px);
}
body {
--container-pdf-cropped-width: var(--line-width);
--container-pdf-cropped-max-width: var(--max-width);
}
.internal-embed.pdf-cropped-embed {
width: var(--container-pdf-cropped-width);
max-width: var(--container-pdf-cropped-max-width);
img {
cursor: text !important;
max-width: 100%;
}
}
.popover.hover-popover>.pdf-cropped-embed img {
max-height: 100%;
max-width: 100%;
height: auto;
}
.pdf-plus-selecting * {
cursor: crosshair !important;
.textLayer {
user-select: none;
}
}
.pdf-container .pdf-plus-select-box {
position: absolute;
z-index: 1000;
border: dashed var(--background-modifier-border) 2px;
background-color: hsla(var(--interactive-accent-hsl), 0.15);
}
/* From Obsidian's app.css (.annotationLayer .mod-focused / .annotationLayer .boundingRect)*/
.pdf-plus-annotation-bounding-rect {
background-color: rgba(var(--text-highlight-bg-rgb), 0.1);
border-radius: var(--radius-s);
box-shadow: var(--shadow-s);
box-sizing: content-box;
margin: calc(var(--size-4-2) * -1);
border: var(--size-4-1) solid rgba(var(--text-highlight-bg-rgb), 0.8);
padding: var(--size-4-1);
z-index: 0;
/* Avoid preventing annotation click */
position: absolute;
pointer-events: none;
}
.popover.hover-popover.pdf-plus-backlink-popover {
--popover-width: var(--pdf-plus-backlink-popover-width, 450px);
--popover-height: var(--pdf-plus-backlink-popover-height, 400px);
}
.popover.hover-popover.pdf-plus-pdf-link-like-popover {
--popover-pdf-width: var(--pdf-plus-pdf-link-like-popover-width, 450px);
--popover-pdf-height: var(--pdf-plus-pdf-link-like-popover-height, 400px);
}
.popover.hover-popover.pdf-plus-bib-popover {
--popover-width: 400px;
--pdf-plus-bib-metadata-font-size: var(--font-ui-small);
/* Workaround to prevent bib popovers from being covered by Hover Editor
when the bib popover is spawned from a hover editor
(https://github.com/RyotaUshio/obsidian-pdf-plus/issues/459).
Hover Editor decides z-index based on --layer-slides, so we need to set a higher z-index. */
z-index: calc(var(--layer-slides) + 1);
.pdf-plus-bib {
padding: var(--size-4-3);
font-size: var(--font-ui-medium);
/* Make text inside citation hover selectable (https://github.com/RyotaUshio/obsidian-pdf-plus/issues/252) */
-moz-user-select: text;
-webkit-user-select: text;
user-select: text;
.bib-title {
font-weight: bold;
padding-bottom: var(--size-4-2);
}
.bib-author-year {
color: var(--text-muted);
text-align: left;
font-size: var(--pdf-plus-bib-metadata-font-size);
}
.bib-container-title {
color: var(--text-muted);
font-style: italic;
text-align: left;
font-size: var(--pdf-plus-bib-metadata-font-size);
}
.button-container {
margin-top: 1em;
display: flex;
justify-content: space-between;
gap: var(--size-4-2);
flex-wrap: wrap;
}
}
}
.pdf-plus-vim-command {
border-top: 1px solid var(--background-modifier-border);
/* height: var(--size-4-8); */
font-family: monospace;
input {
background: transparent;
border: none;
outline: none;
font-family: monospace;
white-space: pre;
width: 90%;
}
}
.page.pdf-plus-vim-hint-mode [data-pdf-plus-vim-hint]::after {
content: attr(data-pdf-plus-vim-hint);
color: var(--pdf-plus-vim-hint-color);
text-transform: uppercase;
font-size: var(--font-ui-medium);
font-weight: bold;
background-color: var(--pdf-plus-vim-hint-background-color);
border: var(--size-2-1) solid hsl(var(--accent-h), var(--accent-s), var(--accent-l));
border-radius: 10%;
padding: 0 var(--size-2-2);
position: relative;
left: 0;
top: 0;
z-index: 9999;
}
body {
--pdf-plus-vim-hint-color: var(--text-normal);
--pdf-plus-vim-hint-background-color: var(--background-primary);
}
body.pdf-plus-vim-hint-inverted {
--pdf-plus-vim-hint-color: var(--text-on-accent);
--pdf-plus-vim-hint-background-color: hsl(var(--accent-h), var(--accent-s), var(--accent-l));
}
+85 -17
View File
File diff suppressed because one or more lines are too long
@@ -0,0 +1,87 @@
---
status: seed
type: concept
tags: [django, backend, orm, database, migrations]
created: 2026-05-30
updated: 2026-05-30
title: Django: Модели и ORM
source: ["[[lec1-django_start_models-1.pdf]]", "[[lec4-django_lec_queries.pdf]]", "[[p1-django-1.pdf]]"]
---
# Django Модели и ORM
**Django ORM (Object-Relational Mapping)** — технология связи объектно-ориентированного кода и реляционной БД. Реализует паттерн Active Record.
## Структура проекта
- `manage.py`: Утилита командной строки.
- `settings.py`: Конфигурация проекта (БД, `INSTALLED_APPS`).
- `urls.py`: Описание маршрутов.
- `models.py`: Определение таблиц БД.
## Определение моделей
```python
from django.db import models
class Person(models.Model):
first_name = models.CharField("Имя", max_length=30)
age = models.IntegerField(default=18)
bio = models.TextField(blank=True)
class Meta:
verbose_name = "Человек"
ordering = ["-first_name"]
```
### Типы полей
- `AutoField`, `CharField(max_length=N)`, `TextField`.
- `IntegerField`, `DecimalField(max_digits, decimal_places)`.
- `BooleanField`, `DateField`, `DateTimeField`.
- `EmailField`, `FileField`, `ImageField`.
### Отношения
- `ForeignKey(Target, on_delete=models.CASCADE)` — Один ко многим.
- `OneToOneField(Target, on_delete=models.CASCADE)` — Один к одному.
- `ManyToManyField(Target)` — Многие ко многим.
- **on_delete:** `CASCADE`, `PROTECT`, `SET_NULL`, `SET_DEFAULT`, `DO_NOTHING`.
---
## Миграции
Инструмент для синхронизации моделей с БД.
- `python manage.py makemigrations` — создать файлы миграций.
- `python manage.py migrate` — применить изменения в БД.
- `python manage.py showmigrations` — список статусов миграций.
---
## Работа с QuerySet (Запросы)
Django QuerySet ленивы (вычисляются только при обращении) и поддерживают цепочки методов.
### Базовые CRUD операции
- **Create:** `obj = Person.objects.create(name="Ivan")` или `obj.save()`.
- **Read:**
- `Person.objects.all()` (все),
- `Person.objects.get(id=1)` (один),
- `Person.objects.filter(age__gt=20)` (фильтрация).
- **Update:** `Person.objects.filter(id=1).update(age=25)`.
- **Delete:** `obj.delete()` или `QuerySet.delete()`.
### Поиск по полям (Field Lookups)
- `exact`, `iexact` (регистронезависимо).
- `gt` (>), `gte` (>=), `lt` (<), `lte` (<=).
- `contains`, `icontains`.
- `in` (список), `range` (диапазон).
- `isnull=True`.
### Оптимизация запросов
- `select_related('field')`: INNER JOIN для ForeignKey и OneToOne.
- `prefetch_related('field')`: 2-й запрос для ManyToMany и обратных связей.
- **Проблема N+1:** Возникает при обращении к связанным полям в цикле без предварительной подгрузки.
### Агрегация и аннотация
- `aggregate(Avg('rating'))`: терминальный метод, возвращает словарь.
- `annotate(total=Count('entries'))`: добавляет вычисляемое поле к каждому объекту в выборке.
### Логические условия
- `Q-объекты`: Позволяют использовать `OR` (`|`), `AND` (`&`), `NOT` (`~`).
- `F-выражения`: Ссылки на поля в БД (атомарные операции без Race Condition).
@@ -0,0 +1,69 @@
---
status: seed
type: concept
tags: [django, routing, templates, cbv, fbv]
created: 2026-05-30
updated: 2026-05-30
title: Django: Представления, шаблоны и CBV
source: ["[[lec2-django_lec_urls_views_templates-1.pdf]]", "[[lec3-django_cbv-1.pdf]]", "[[p4-django_cbv-1.pdf]]"]
---
# Django: Представления и Шаблоны
## Маршрутизация (URL Routing)
- Описывается в `urlpatterns` с помощью `path()` и `re_path()`.
- Конвертеры: `<int:pk>`, `<slug:slug>`, `<uuid:id>`.
- Включение других файлов: `path('blog/', include('blog.urls'))`.
- Реверсирование: `{% url 'name' %}` в шаблонах или `reverse('name')` в Python.
---
## Представления (Views)
Views принимают `HttpRequest` и возвращают `HttpResponse`.
### Функциональные представления (FBV)
```python
from django.shortcuts import render, get_object_or_404
def index(request):
latest_items = Model.objects.all()[:5]
return render(request, "app/index.html", {"items": latest_items})
```
### Классовые представления (CBV)
Абстрагируют типичные задачи. Вызываются в URL через `.as_view()`.
- **TemplateView:** Отображение статического шаблона.
- **ListView:** Автоматический список объектов (данные в `object_list`).
- **DetailView:** Детальная информация об одном объекте (ищет по `pk` или `slug`).
**Пример ListView:**
```python
class PostListView(ListView):
model = Post
template_name = "blog/list.html"
context_object_name = "posts"
paginate_by = 10
```
---
## Шаблоны (Templates)
Используют **Django Template Language (DTL)**.
### Синтаксис
- **Переменные:** `{{ var.attr }}`.
- **Теги:** `{% if %}`, `{% for %}`, `{% url %}`, `{% csrf_token %}`.
- **Фильтры:** `{{ date|date:"Y-m-d" }}`, `{{ list|length }}`, `{{ text|lower }}`.
### Наследование шаблонов
Позволяет избежать дублирования HTML-кода.
- **Базовый шаблон (`base.html`):** Определяет блоки `{% block content %}{% endblock %}`.
- **Дочерний шаблон:** Использует `{% extends "base.html" %}` и переопределяет блоки.
---
## Статические файлы (Static)
- Подключаются через `{% load static %}`.
- Настройки в `settings.py`: `STATIC_URL`, `STATICFILES_DIRS`.
- В продакшне используется команда `python manage.py collectstatic`.
@@ -0,0 +1,81 @@
---
status: seed
type: concept
tags: [django, forms, crud, validation, modelform]
created: 2026-05-30
updated: 2026-05-30
title: Django: Работа с формами и CUD
source: ["[[lec5-django_cud_form.pdf]]"]
---
# Django: Формы и CUD
**CUD (Create, Update, Delete)** — операции изменения данных. Django предоставляет мощную подсистему форм для их реализации.
## Типы форм
1. **`forms.Form`**: Для общих задач (поиск, обратная связь), не привязанных к моделям.
2. **`forms.ModelForm`**: Автоматическая генерация полей на основе модели.
```python
class BlogForm(forms.ModelForm):
class Meta:
model = Blog
fields = ['name', 'tagline']
widgets = {
'name': forms.TextInput(attrs={'class': 'form-control'})
}
```
---
## Жизненный цикл формы в представлении
```python
def contact_view(request):
if request.method == "POST":
form = ContactForm(request.POST)
if form.is_valid():
# Данные очищены и доступны в form.cleaned_data
data = form.cleaned_data
# Действие (сохранение или отправка email)
return redirect('success')
else:
form = ContactForm()
return render(request, 'contact.html', {'form': form})
```
---
## Валидация и очистка данных
- **`is_valid()`**: Запускает процесс проверки.
- **Автоматическая очистка**: Превращает текст в типы Python (например, строку в `datetime`).
- **`clean_<fieldname>()`**: Валидация конкретного поля.
- **`clean()`**: Валидация всей формы (сравнение полей).
---
## Generic Editing Views (CBV для CUD)
Django предоставляет готовые классы для CRUD:
- **CreateView**: Создание объекта.
- **UpdateView**: Редактирование (требует `pk` в URL).
- **DeleteView**: Удаление (требует подтверждения через POST).
**Пример:**
```python
class BlogCreateView(CreateView):
model = Blog
form_class = BlogForm
template_name = "blog/blog_form.html"
success_url = reverse_lazy('blog_list')
```
## Отображение в шаблоне
- `{{ form.as_p }}` — в параграфах.
- `{{ form.as_table }}` — в строках таблицы.
- **Ручное управление:**
```html
{% for field in form %}
{{ field.label_tag }} {{ field }}
{{ field.errors }}
{% endfor %}
```
*Важно:* Не забывайте про `{% csrf_token %}` внутри тега `<form>`.
@@ -0,0 +1,73 @@
---
status: seed
type: concept
tags: [python, syntax, programming-basics, functional-programming]
created: 2026-05-30
updated: 2026-05-30
title: Python: Базовый синтаксис и основы
source: ["[[50-python-lec.pdf]]"]
---
# Основы Python
**Python** — высокоуровневый объектно-ориентированный язык программирования с «двумерным синтаксисом» (структура определяется отступами).
## Вывод и ввод данных
- **Вывод:** `print("текст", sep=" ", end="\n")`.
- **f-строки:** `print(f"Значение: {var}")`.
- **Ввод:** `input("Приглашение")` — всегда возвращает строку.
## Типы данных
1. **int**: целые числа.
2. **float**: числа с плавающей точкой.
3. **bool**: `True` / `False`.
4. **str**: строки (Unicode).
5. **list**: изменяемые списки.
6. **tuple**: неизменяемые кортежи.
7. **set**: множества уникальных элементов.
8. **dict**: словари (ключ-значение).
### Приведение типов
`int()`, `float()`, `str()`, `bool()`, `list()`.
---
## Управляющие конструкции
### Условия
```python
if condition1:
# действие
elif condition2:
# действие
else:
# действие по умолчанию
```
### Циклы
- **while**: пока условие истинно.
- **for**: обход последовательности (`range`, `list`, `str`).
- **else в циклах**: выполняется, если цикл не был прерван `break`.
---
## Функции
Определяются через `def`.
```python
def my_function(param, optional=10):
return param + optional
```
- `*args`: произвольное количество позиционных аргументов (кортеж).
- `**kwargs`: произвольное количество именованных аргументов (словарь).
---
## Работа со списками и итераторами
- **Слайсы (срезы):** `list[start:stop:step]`.
- **Методы:** `append()`, `extend()`, `insert()`, `remove()`, `pop()`, `sort()`.
- **Функциональное программирование:**
- `lambda x: x**2` (анонимные функции).
- `map(func, iterable)` (применение к каждому).
- `filter(func, iterable)` (фильтрация по условию).
- `reduce(func, iterable)` (свертка списка).
@@ -0,0 +1,68 @@
---
status: seed
type: concept
tags: [python, oop, classes, inheritance, polymorphism, encapsulation]
created: 2026-05-30
updated: 2026-05-30
title: Основы объектно-ориентированного программирования
source: ["[[oop.pdf]]"]
---
# Основы ООП в Python
**ООП** — методология, в основе которой лежат понятия **класса** (шаблон) и **объекта** (экземпляр).
## Четыре столпа ООП
1. **Абстракция:** Выделение ключевых характеристик объекта и отсечение незначимых.
2. **Инкапсуляция:** Сокрытие внутренней логики и данных. В Python реализуется соглашением об именовании:
- `_name`: «защищенный» (не рекомендуется трогать вне класса).
- `__name`: «приватный» (имя искажается для предотвращения прямого доступа).
3. **Наследование:** Создание новых классов на базе существующих. Все классы наследуются от `object`.
4. **Полиморфизм:** Возможность использовать разные типы данных через единый интерфейс.
- *Полиморфизм подтипов:* Использование потомка вместо родителя.
- *Параметрический:* Обработка данных любого типа (например, `len()`).
- *Ad-hoc:* Перегрузка функций (в Python через разные аргументы).
---
## Работа с классами
```python
class Rectangle:
default_color = "green" # Атрибут класса (статический)
def __init__(self, width, height):
self.width = width # Атрибут экземпляра
self.height = height
def area(self): # Метод экземпляра
return self.width * self.height
@classmethod
def change_color(cls, color):
cls.default_color = color
@staticmethod
def hint():
print("Это прямоугольник")
```
### Специальные методы (Магические методы)
- `__init__`: Инициализатор (вызывается после создания объекта).
- `__new__`: Конструктор (вызывается для создания экземпляра).
- `__str__`: Строковое представление (для `print()`).
---
## Наследование
```python
class Square(Rectangle):
def __init__(self, side):
super().__init__(side, side) # Вызов родительского инициализатора
```
- `super()` — ссылка на родительский класс.
---
## Модули и пакеты
- **Модуль:** Любой `.py` файл. Подключается через `import`.
- **Пакет:** Папка с файлом `__init__.py`. Помогает Python находить вложенные модули.
@@ -0,0 +1,70 @@
---
status: seed
type: concept
tags: [css, flexbox, grid, adaptive-design, responsive-web]
created: 2026-05-30
updated: 2026-05-30
title: CSS: Адаптивность, Flexbox и Grid
source: ["[[14-css-adaptive.pdf]]", "[[17-css-grid.pdf]]", "[[18-css-flex.pdf]]"]
---
# Адаптивная верстка
Адаптивность (AWD) и отзывчивость (RWD) позволяют сайту корректно отображаться на любых устройствах.
## Медиазапросы (@media)
Синтаксис:
```css
@media screen and (max-width: 768px) {
/* Стили для планшетов и телефонов */
}
```
- **Mobile First:** Сначала стили для мобильных, затем `min-width`.
- **Desktop First:** Сначала для десктопов, затем `max-width`.
---
# Flexbox (Flexible Box Layout)
Одномерная модель раскладки (по одной оси).
- **Контейнер:** `display: flex;` / `inline-flex;`.
- **Направление:** `flex-direction: row | column | row-reverse`.
- **Перенос:** `flex-wrap: wrap | nowrap`.
- **Выравнивание по главной оси:** `justify-content: flex-start | center | space-between | space-around`.
- **Выравнивание по поперечной оси:** `align-items: center | stretch`.
- **Свойства элементов:**
- `flex-grow` (коэффициент роста),
- `flex-shrink` (сжатие),
- `flex-basis` (базовый размер),
- `order` (порядок отображения).
---
# Grid Layout
Двумерная модель раскладки (строки + столбцы).
- **Контейнер:** `display: grid;`.
- **Определение сетки:**
- `grid-template-columns: repeat(3, 1fr);` (3 колонки равной ширины).
- `grid-template-rows: auto 1fr;`.
- **Единица fr:** Доля свободного пространства.
- **Отступы:** `gap: 10px;`.
- **Размещение элементов:**
- `grid-column: 1 / 3;` (от 1-й до 3-й линии).
- `grid-row: 2 / span 2;` (со 2-й линии на 2 ячейки).
- **Именованные области:**
```css
.container {
grid-template-areas:
"header header"
"sidebar content"
"footer footer";
}
header { grid-area: header; }
```
---
# Сравнение Flex и Grid
- **Flexbox:** Лучше для одномерных структур (меню, тулбары) и распределения пространства между элементами.
- **Grid:** Лучше для сложных макетов всей страницы, перекрытия элементов и точного контроля над строками и столбцами одновременно.
@@ -0,0 +1,84 @@
---
status: seed
type: concept
tags: [css, web-development, selectors, box-model]
created: 2026-05-30
updated: 2026-05-30
title: CSS: Основы, селекторы и блочная модель
source: ["[[11-css-основы_селекторы.pdf]]", "[[12-css-базовые_свойства.pdf]]", "[[12-css-блочная_модель.pdf]]", "[[12-css-фон.pdf]]"]
---
# CSS: Основы и селекторы
**CSS (Cascading Style Sheets)** — язык таблиц стилей для оформления HTML-документов.
## Подключение CSS
1. **Внешняя таблица:** `<link rel="stylesheet" href="style.css">`.
2. **Внутренние стили:** Тег `<style>` в `<head>`.
3. **Встроенные (inline) стили:** Атрибут `style` у тега.
## Селекторы
- **Универсальный:** `*` — все элементы.
- **По тегу:** `h1`, `p`.
- **По классу:** `.className`.
- **По ID:** `#idName`.
- **Потомки:** `div p` (все `p` внутри `div`).
- **Дочерние:** `div > p` (только прямые наследники).
- **Соседние:** `h1 + p` (первый `p` после `h1`).
- **По атрибуту:** `a[href^="https://"]`.
### Псевдоклассы и псевдоэлементы
- `:hover`, `:focus`, `:active`.
- `:nth-child(odd/even/n)`.
- `::before`, `::after` (используются с `content`).
## Каскадность и Специфичность
Если правила конфликтуют, побеждает то, у которого выше специфичность:
1. Inline стили (1, 0, 0, 0)
2. ID (0, 1, 0, 0)
3. Классы, атрибуты, псевдоклассы (0, 0, 1, 0)
4. Теги и псевдоэлементы (0, 0, 0, 1)
---
# Блочная модель (Box Model)
Каждый элемент в CSS — это прямоугольный блок.
- **Content:** Содержимое (текст, изображение).
- **Padding:** Внутренние поля (между контентом и рамкой).
- **Border:** Рамка.
- **Margin:** Внешние отступы (между рамкой и соседями).
### box-sizing
- `content-box` (по умолчанию): `width` задает только ширину контента.
- `border-box`: `width` включает в себя `padding` и `border`.
## Свойство display
- `block`: Занимает всю ширину, начинается с новой строки.
- `inline`: Ширина по контенту, не позволяет задавать `width/height`.
- `inline-block`: Строчный элемент, но с возможностью задавать размеры и отступы.
- `none`: Убирает элемент из документа.
---
# Базовые свойства оформления
## Текст и шрифты
- `font-family`, `font-size`, `font-weight`.
- `text-align`, `text-transform` (`uppercase`, `capitalize`).
- `text-decoration` (`underline`, `none`).
- `line-height`, `letter-spacing`.
## Фон (Background)
- `background-color`.
- `background-image: url(...)`.
- `background-size: cover / contain`.
- `background-repeat: no-repeat`.
- `background-position: center`.
## Границы и тени
- `border: 1px solid black;`.
- `border-radius: 5px;` (скругление углов).
- `box-shadow: x y blur spread color;`.
- `transition: 0.3s;` (плавные переходы).
@@ -0,0 +1,59 @@
---
status: seed
type: concept
tags: [bootstrap, web-development, css-framework, grid-system]
created: 2026-05-30
updated: 2026-05-30
title: Основы Bootstrap
source: ["[[21-bootstrap-1.pdf]]"]
---
# Bootstrap 5
**Bootstrap** — популярный HTML/CSS/JS фреймворк для быстрой разработки адаптивных интерфейсов.
## Быстрый старт
Для использования через CDN добавьте в `<head>`:
```html
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.x/dist/css/bootstrap.min.css" rel="stylesheet">
```
И скрипты перед `</body>`:
```html
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.x/dist/js/bootstrap.bundle.min.js"></script>
```
## Контрольные точки (Breakpoints)
- **X-Small (`<576px`)**: по умолчанию.
- **Small (`sm` ≥576px)**.
- **Medium (`md` ≥768px)**.
- **Large (`lg` ≥992px)**.
- **Extra large (`xl` ≥1200px)**.
- **Extra extra large (`xxl` ≥1400px)**.
## Сетка (Grid System)
Базируется на Flexbox и состоит из контейнеров, строк и колонок (12 колонок в ряду).
```html
<div class="container">
<div class="row">
<div class="col-12 col-md-8">Основной контент</div>
<div class="col-6 col-md-4">Сайдбар</div>
</div>
</div>
```
- `.container`: фиксированная ширина (меняется на брейкпоинтах).
- `.container-fluid`: всегда 100% ширины.
- `.row`: обертка для колонок.
- `.col-{breakpoint}-{size}`: настройка ширины колонки.
## Основные классы-утилиты
- **Отступы:** `m-3` (margin), `p-2` (padding), `mt-1` (margin-top).
- **Цвета:** `text-primary`, `bg-dark`, `btn-success`.
- **Типографика:** `h1`, `display-1`, `text-center`, `fw-bold`.
- **Flexbox:** `d-flex`, `justify-content-between`, `align-items-center`.
## Компоненты
Bootstrap предоставляет готовые стили для:
- Кнопок (`btn`), форм, навигационных панелей (`navbar`).
- Карточек (`card`), алертов (`alert`), модальных окон.
- Пагинации, списков, таблиц.
@@ -0,0 +1,111 @@
---
status: seed
type: concept
tags: [html, web-development, structure, tables, forms]
created: 2026-05-30
updated: 2026-05-30
title: Основы HTML (структура, таблицы, формы)
source: ["[[10-html_основы_НП.pdf]]", "[[13-html-таблицы.pdf]]", "[[15-html-формы-1.pdf]]"]
---
# Основы HTML
**HTML (Hypertext Markup Language)** — язык разметки для структурирования и отображения веб-страниц.
## Структура HTML-документа
Базовый шаблон (HTML5):
```html
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Заголовок страницы</title>
</head>
<body>
<!-- Контент страницы -->
</body>
</html>
```
- `<!DOCTYPE html>` — объявление типа документа.
- `<head>` — метаданные (не отображаются в браузере).
- `<body>` — основное содержимое.
### Метатег Viewport
Критичен для мобильных устройств. Позволяет контролировать масштаб.
```html
<meta name="viewport" content="width=device-width, initial-scale=1.0">
```
## Основные теги и семантика
HTML5 вводит семантические теги для улучшения понимания структуры поисковиками и программами экранного доступа:
- `<header>`, `<nav>`, `<main>`, `<section>`, `<article>`, `<aside>`, `<footer>`.
### Текст и форматирование
- **Заголовки:** `<h1>`...`<h6>`.
- **Абзацы и переносы:** `<p>`, `<br>`.
- **Логическое выделение:** `<strong>` (важное, жирный), `<em>` (акцент, курсив), `<code>` (код).
- **Контейнеры:** `<div>` (блочный), `<span>` (строчный).
### Списки
- **Маркированный:** `<ul>` + `<li>`.
- **Нумерованный:** `<ol>` + `<li>`.
### Ссылки и изображения
- **Ссылка:** `<a href="URL" target="_blank">Текст</a>`.
- **Изображение:** `<img src="path" alt="описание" width="500">`.
---
## Таблицы
Используются для отображения структурированных данных. Не рекомендуются для верстки макета.
**Структура таблицы:**
```html
<table>
<caption>Заголовок таблицы</caption>
<thead>
<tr>
<th>Заголовок столбца 1</th>
<th>Заголовок столбца 2</th>
</tr>
</thead>
<tbody>
<tr>
<td>Данные 1</td>
<td>Данные 2</td>
</tr>
</tbody>
<tfoot>
<tr>
<td>Итог 1</td>
<td>Итог 2</td>
</tr>
</tfoot>
</table>
```
- **Объединение ячеек:** `colspan` (по горизонтали), `rowspan` (по вертикали).
---
## Формы
Инструмент для сбора данных пользователя.
**Базовая форма:**
```html
<form action="/handler-url/" method="post">
<label for="username">Имя:</label>
<input type="text" id="username" name="name" placeholder="Введите имя">
<button type="submit">Отправить</button>
</form>
```
### Элементы управления:
- `<input>`: `type="text"`, `password`, `email`, `number`, `checkbox`, `radio`, `file`, `date`, `hidden`.
- `<select>` + `<option>`: выпадающий список.
- `<textarea>`: многострочный ввод текста.
- `<fieldset>` + `<legend>`: группировка связанных полей.
### Атрибуты валидации:
- `required`, `minlength`, `maxlength`, `min`, `max`, `pattern` (регулярные выражения).