Skip to content

Commit

Permalink
fix: meta tags
Browse files Browse the repository at this point in the history
  • Loading branch information
osmancoskun committed May 20, 2024
1 parent 4bbdc95 commit d5b12de
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 55 deletions.
2 changes: 1 addition & 1 deletion mdsvex.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineMDSveXConfig as defineConfig } from "mdsvex";
const config = defineConfig({
extensions: [".md", ".svx"],
extensions: [".md", ".svx", ".svelte"],
layout: {
default: "./src/routes/wiki/default-layout.svelte",
fancy: "./src/routes/wiki/default-layout.svelte",
Expand Down
5 changes: 5 additions & 0 deletions src/routes/wiki/development/c/_module.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<svelte:head>
<title>C Programming</title>
<meta name="description" content="C Programming in Linux" />
</svelte:head>
<slot />
30 changes: 15 additions & 15 deletions src/routes/wiki/development/c/c-00-101.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
---
layout: default
title: "C 101"
date: 2024-05-20 00:00:00
cover_image: "https://raw.githubusercontent.com/pardus/pardus.github.io/main/src/lib/assets/c-cover.png"
categories: main
tag: "advanced"
author: "Aliriza Keskin"
---
#### 2024.05.20 - [Aliriza Keskin](https://github.com/sulincix)

# C gtk tutorial

C is one of the most fundamental programming languages.
Expand All @@ -16,12 +8,14 @@ Being a compiled language, it requires a compiler such as gcc or clang.
## Installing compiler

You can use `apt install gcc` command to install gcc.

```shell
$ apt install gcc
```

Or you can prefer clang:
You can use `apt install clang` command to install clang.

```shell
$ apt install clang
```
Expand All @@ -32,7 +26,7 @@ Every GNU/Linux distribution comes with a libc.
Libc is the most basic library on the system, and all programs, regardless of what they are written in, eventually call libc functions somewhere.
Writing programs without using libc functions is very difficult.

Pardus GNU/Linux prefer glibc as libc library.
Pardus GNU/Linux prefer glibc as libc library.

You must install **libc6-dev** package for libc development files.

Expand All @@ -52,29 +46,35 @@ int main(int argc, char** argv){
return 0;
}
```
### Explaining hello world
```c
#include <stdio.h>
```
* `#include <stdio.h>` This line is a preprocessor directive that tells the compiler to include the contents of the stdio.h header file.

- `#include <stdio.h>` This line is a preprocessor directive that tells the compiler to include the contents of the stdio.h header file.
This header file contains declarations for standard input/output functions like printf and scanf, which are used in the program.

```c
int main(int argc, char** argv) {
```
* `int main(int argc, char** argv) {` This line defines the main function of the program.
- `int main(int argc, char** argv) {` This line defines the main function of the program.
In C, every program must have a main function, which serves as the entry point of the program. It takes two arguments: argc, an integer representing the number of command-line arguments passed to the program, and argv, an array of strings containing the actual command-line arguments.
```c
printf("Hello World\n");
```

* `printf("Hello World\n");` This line uses the printf function to print the string "Hello World" to the standard output (usually the console).
- `printf("Hello World\n");` This line uses the printf function to print the string "Hello World" to the standard output (usually the console).
The \n represents a newline character, which moves the cursor to the next line after printing "Hello World".

```c
}
```
* This closing curly brace marks the end of the main function block.

- This closing curly brace marks the end of the main function block.
All the code within the main function is enclosed between `{` and `}`.

### Compile code
Expand All @@ -85,4 +85,4 @@ Compile code like this and run:
$ gcc main.c -o main
$ ./main
>>> Hello World
```
```
12 changes: 3 additions & 9 deletions src/routes/wiki/development/c/c-01-syntax.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
---
layout: default
title: "C syntax"
date: 2024-05-20 00:00:00
cover_image: "https://raw.githubusercontent.com/pardus/pardus.github.io/main/src/lib/assets/c-cover.png"
categories: main
tag: "advanced"
author: "Aliriza Keskin"
---
#### 2024.05.20 - [Aliriza Keskin](https://github.com/sulincix)

# C Syntax

C is a compiled programming language.
Expand All @@ -33,6 +25,7 @@ Note: Our compiler can also directly compile without generating .o.
```shell
$ gcc -o main main.c
```

## Commenting

There are three ways to comment in C code:
Expand Down Expand Up @@ -155,6 +148,7 @@ int *array = {12, 22, 31};
```

Or, declaring with a specified length:

```c
int array[3] = {12, 22, 31};
```
Expand Down
6 changes: 6 additions & 0 deletions src/routes/wiki/development/python/_module.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<svelte:head>
<title>Python Programming</title>
<meta name="description" content="Python Programming in Linux" />
</svelte:head>

<slot />
37 changes: 19 additions & 18 deletions src/routes/wiki/development/python/python-gtk-00.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,24 @@
---
layout: default
title: "Developing Linux GUI Applications with Python and GTK4"
date: 2023-05-12 00:00:00
cover_image: "https://raw.githubusercontent.com/pardus/pardus.github.io/main/src/lib/assets/python-cover.png"
categories: main
tag: "advanced"
author: "Osman Coskun"
---
#### 2023.05.12 - [Osman Coskun](https://github.com/osmancoskun)
# Developing Linux GUI Applications with Python and GTK4
#### 2023.05.12 - [Osman Coskun](https://github.com/osmancoskun)

# Developing Linux GUI Applications with Python and GTK4

Unlock the potential of Linux GUI application development using Python and GTK4. In this guide, we explore the powerful combination of Python's simplicity with GTK4's extensive widget library. Whether you're a beginner or experienced Python developer, this post provides a solid foundation to create stunning cross-platform desktop applications. Explore the core concepts, set up your development environment, build your first application, explore advanced topics, and learn about packaging and deployment. Let's improve ourselves to shape the future of Linux application development.

#### Python is very easy to read and understand programming language. All we have to do is creating a `.py` file and start coding.
* Just use your favourite text editor. You dont need an full-featured IDE to start coding. I suggest you to use ** [Visual Studio Code](https://code.visualstudio.com/) **
* I assume that you know basic level programming on Python. So we can start by reading some documents. For documents you can use ** [this link](https://amolenaar.github.io/pgi-docgen/) ** which is GTK4 documentation for Python. Also you can use ** [Black Formatter](https://marketplace.visualstudio.com/items?itemName=ms-python.black-formatter) ** Visual Studio Code extension for GTK4 widgets, their classes and functions that can be used with.
* Now create a file that ends with `.py` . For example lets say `myapp.py`
* For using GTK4 we need to import `gi` and specify GTK with version 4. Now lets add following code into our application.

- Just use your favourite text editor. You dont need an full-featured IDE to start coding. I suggest you to use ** [Visual Studio Code](https://code.visualstudio.com/) **
- I assume that you know basic level programming on Python. So we can start by reading some documents. For documents you can use ** [this link](https://amolenaar.github.io/pgi-docgen/) ** which is GTK4 documentation for Python. Also you can use ** [Black Formatter](https://marketplace.visualstudio.com/items?itemName=ms-python.black-formatter) ** Visual Studio Code extension for GTK4 widgets, their classes and functions that can be used with.
- Now create a file that ends with `.py` . For example lets say `myapp.py`
- For using GTK4 we need to import `gi` and specify GTK with version 4. Now lets add following code into our application.

```python
import gi
gi.require_version('Gtk','4.0')
from gi.repository import Gtk
```
* Now we can start using GTK widgets. But first we need a window to show our application.

- Now we can start using GTK widgets. But first we need a window to show our application.

```python
def on_activate(app):
win = Gtk.ApplicationWindow(application=app)
Expand All @@ -30,9 +27,13 @@ app = Gtk.Application()
app.connect('activate', on_activate)
app.run(None)
```
* Now we can run our application with

- Now we can run our application with

```bash
python myapp.py
```

![Simple Window](https://raw.githubusercontent.com/pardus/pardus.github.io/main/src/lib/assets/python-gtk-00-1.png)
* We will go deeper on next posts.

- We will go deeper on next posts.
14 changes: 2 additions & 12 deletions src/routes/wiki/development/python/python-gtk-01.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
---
layout: default
title: "Utilizing GTK Containers for Linux GUI Application Development with Python"
date: 2023-05-26 00:00:00
cover_image: "https://raw.githubusercontent.com/pardus/pardus.github.io/main/src/lib/assets/python-cover.png"
categories: main
tag: "advanced"
author: "Osman Coskun"
---
#### 2023.05.26 - [Osman Coskun](https://github.com/osmancoskun)
#### 2023.05.26 - [Osman Coskun](https://github.com/osmancoskun)

# Utilizing GTK Containers for Linux GUI Application Development with Python

Expand Down Expand Up @@ -61,7 +52,6 @@ app.run(None)

Now, let's create a button called Button:


```python
button = Gtk.Button(label='Button')
```
Expand All @@ -82,7 +72,6 @@ box.append(button)

Currently, we have a box with a button in it. We can set this container as a child of our application:


```python
win.set_child(box)
```
Expand All @@ -94,6 +83,7 @@ To adjust the size of our application window, we can set a fixed size by definin
```python
win.set_size_request(200, 200)
```

![](https://raw.githubusercontent.com/pardus/pardus.github.io/main/src/lib/assets/python-gtk-01-2.png)

Below is the complete code:
Expand Down

0 comments on commit d5b12de

Please sign in to comment.