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

Reordering and cleaning the difference between doing and learning. #67

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

PhilStollery
Copy link

Fixes #8

This is my first PR into the Open Documentation Academy. I've read the Canonical style guide but I still have some style questions:

  • When highlighting interface elements on screenshots — is there a standard colour or shape (round rect - Ubuntu orange is what I used)?
  • Does Canonical like to reference the readers as YOU or include them with WE?
  • Is there a preferred code referencing style for parameters to code (I used )?
  • I saw conflicting Markdown and HTML for headers — I made all of them Markdown.

My aim for this PR was removing doing content into the How To document. The explanation is now maybe a bit too simple? Should I expand on it?

@PhilStollery PhilStollery marked this pull request as draft May 13, 2024 14:24
@PhilStollery PhilStollery marked this pull request as ready for review May 13, 2024 14:24
@degville
Copy link
Collaborator

Hi @PhilStollery. Thanks so much for this, and sorry for the delay responding. I'll take a look at your PR, but to answer your excellent questions first:

When highlighting interface elements on screenshots — is there a standard colour or shape (round rect - Ubuntu orange is what I used)?

We don't have a standard because our standard approach is usually to try and avoid screenshots, for a few important reasons. They're difficult to maintain, and GUI elements often change, quickly making screenshots out of date. They're also difficult to find through a documentation search, especially if you're looking for a description. There are accessibility issues too, perhaps for people who can't use a normal display, and they're difficult to fit into translated documentation.

This page is one of our few examples, though, because sometimes you do indeed need to show what you're writing about. What you've done looks good.

Does Canonical like to reference the readers as YOU or include them with WE?

Good question! You can probably find examples of both in our docs, but we do have a strong preference for you.

Is there a preferred code referencing style for parameters to code (I used )?

No, but we absolutely should! This might actually be a great challenge for the Academy.

I saw conflicting Markdown and HTML for headers — I made all of them Markdown.

Thanks! You did the right thing. The reason for the HTML headers is to make-up for a limitation in Discourse documentation.

@PhilStollery
Copy link
Author

Any update on my PR?

Copy link
Collaborator

@degville degville left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥳 Thanks so much for all this work! Fundamentally, I think it's a great improvement. I've left a few comments for a few things, but there's nothing major.


The creator of a snap selects the interfaces that a snap requires in order to function correctly. Common interfaces include those that provide access to the [network](/t/the-network-interface/7880), [desktop features](/t/the-desktop-interfaces/2042) and the [sound system](/t/the-pulseaudio-interface/7906).
The creator of a snap selects the category of interfaces that a snap requires in order to function correctly. Common categories include [network](/t/the-network-interface/7880), [desktop](/t/the-desktop-interfaces/2042) and the [sound system](/t/the-pulseaudio-interface/7906). <!-- TODO find out how to get the correct URL this link is out of date: should reference https://snapcraft.io/docs/audio-playback-interface>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While interfaces do belong to categories, I think it's more accurate to point out that the snap creator selects a specific interface rather than an interface category.

is connected to a slot in another snap providing that resource.
A analogy to this is plugging an appliance into an electrical outlet that
provides the power it needs.
A connection between snaps is made when a plug from a snap needing a resource is connected to a slot in another snap providing that resource. An analogy to this is plugging an appliance into an electrical outlet that provides the power it needs.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good, thank you! Although not in the original text either, I think it may be worth pointing out that, most commonly, a connection is made between an application snap and the system snap, which permits access to system resource (the system snap isn't even listed, but can be seen as a colon : in the connections lists, eg. :x11.


As with [classic confinement](/t/33649), a snap's publisher can request an *assertion* to automatically connect an otherwise non-auto-connecting interface. For example, the *guvcview* snap [requested](https://forum.snapcraft.io/t/auto-connect-request-for-the-guvcview-brlin-snap/6042) the camera interface be automatically-connected when the snap is installed.
As with [classic confinement](/t/33649), a snap's publisher can request an *assertion* to automatically connect an otherwise non-auto-connecting interface. For example, the *guvcview* snap [requests](https://forum.snapcraft.io/t/auto-connect-request-for-the-guvcview-brlin-snap/6042) the camera interface automatically-connect when the snap is installed.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is in the original too, but it might be worth explaining an assertion. Or even remove the reference to assertions? It's quite a complicated subject for an introduction to interfaces, and may not be necessary for readers to understand. They may be better off just knowing that snap developers can also request that an interface is connected automatically.


![How an interfaces uses a plug and a slot](https://assets.ubuntu.com/v1/59c290a8-snapd-interfaces.png)
![A diagram showing two Snaps connected via an interface. The first Snap A is the consumer - shown with a plug. Snap B is the provider - shown with a slot.](https://assets.ubuntu.com/v1/59c290a8-snapd-interfaces.png)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for improving the alt text!


An interface is most commonly used to enable a snap to access sound playback or recording, your network, and your $HOME directory. But which interfaces a snap requires, and *provides*, is very much dependent on the type of snap and its own requirements.

See [Supported interfaces](/t/supported-interfaces/7744) for a comprehensive list of interfaces and what kind of access they permit.

<h2 id='heading--slots-plugs'>Plugs and slots</h2>
## View all the snaps using an interface
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be interpreted as _using an interface to view all the snaps _. Maybe some more like View the interfaces a snap is using ?


You can see which snaps are using an interface with the `interface` command:
The `interface` command shows the snaps using an interface. For example, for the audio-playback interface you'd see:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's a hint of ambiguity here in shows the snaps using an interface which is easier to understand with the which.

Suggested change
The `interface` command shows the snaps using an interface. For example, for the audio-playback interface you'd see:
The `interface` command shows which snaps are using an interface. For example, for the audio-playback interface you'd see:

```

In the above output, the [`camera`](/t/the-home-interface/7838) interface is not connected because its slot is empty. This means VLC cannot access any connected cameras.
In the previous <!-- above, left, right, below are assuming reading direction --> example, you <!-- TODO Style guide question, as authors should we talk directly to our readers YOU instead of WE --> can see that the `vlc:camera` interface is disconnected because it has an empty *Slot* entry.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. There's no firm guide to this - both we and you are acceptable, but I prefer avoiding them when possible, eg. "In the previous example, the output shows that the vlc:camera..."


![A screenshot of a Snap permissions dialogue.](../media/GIMP-interfaces.png)

Each interface can now be connected or disconnected by selecting the toggle switch to the right of its description, and you may be prompted for your password.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like moving this to the end, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Snap: improve interface management documentation
2 participants