fix: converted single to triple backticks15 (#36242)

This commit is contained in:
Randell Dawson
2019-06-20 13:16:38 -07:00
committed by Tom
parent c5fd478d9a
commit 7917d5c6c3
24 changed files with 364 additions and 312 deletions

View File

@ -8,8 +8,9 @@ localeTitle: الثوابت
#### مثال: #### مثال:
`let name = "Chris Lattner" ```swift
` let name = "Chris Lattner"
```
قمت بتعريف الثوابت مع `let` الكلمة ثم إعطائه اسما `name` ثم كنت تستخدم عامل التعيين `=` لتعيين قيمة `"Chris Lattner"` إلى ثابت `name` . قمت بتعريف الثوابت مع `let` الكلمة ثم إعطائه اسما `name` ثم كنت تستخدم عامل التعيين `=` لتعيين قيمة `"Chris Lattner"` إلى ثابت `name` .

View File

@ -16,27 +16,30 @@ Swift هي لغة برمجة [مفتوحة المصدر](https://en.wikipedia.or
للإعلان عن متغير في Swift ، ببساطة استخدم var متبوعًا باسم المتغير الخاص بك. للإعلان عن متغير في Swift ، ببساطة استخدم var متبوعًا باسم المتغير الخاص بك.
`var x = 6 ```Swift
var name = "Bob" var x = 6
var boole = true var name = "Bob"
var boole = true
x = 3
` x = 3
```
تشبه الثوابت المتغيرات ، لكنها لا يمكن أن تتغير في القيمة بعد الإنشاء. تشبه الثوابت المتغيرات ، لكنها لا يمكن أن تتغير في القيمة بعد الإنشاء.
`let x = 6 ```Swift
let name = "Bob" let x = 6
let boole = true let name = "Bob"
` let boole = true
```
لطباعة أي شيء إلى الإخراج القياسي ، ما عليك سوى استخدام print () ووضع الإخراج في الأقواس. لطباعة أي شيء إلى الإخراج القياسي ، ما عليك سوى استخدام print () ووضع الإخراج في الأقواس.
`let x = "World" ```Swift
let x = "World"
print("Hello ")
print(x) print("Hello ")
` print(x)
```
# الإصدار # الإصدار

View File

@ -9,14 +9,16 @@ localeTitle: نوع المصفوفة
**نوع البيانات\[\]** **نوع البيانات\[\]**
DataType متبوعة بأقواس مربعة `[]` DataType متبوعة بأقواس مربعة `[]`
`let names: string[] = ['Javier', 'Emma', 'John', 'Sophia', 'Emma']; ```typescript
` let names: string[] = ['Javier', 'Emma', 'John', 'Sophia', 'Emma'];
```
**مجموعة <نوع البيانات>** **مجموعة <نوع البيانات>**
`Array` متبوعة <DataType> `Array` متبوعة <DataType>
`let names: Array<string> = ['Javier', 'Emma', 'John', 'Sophia', 'Emma']; ```typescript
` let names: Array<string> = ['Javier', 'Emma', 'John', 'Sophia', 'Emma'];
```
## أساليب مدمجة ## أساليب مدمجة
@ -26,30 +28,33 @@ DataType متبوعة بأقواس مربعة `[]`
يزيل العنصر الأخير من مصفوفة ويعود إليه. يزيل العنصر الأخير من مصفوفة ويعود إليه.
`var element = names.pop(); ```typescript
//element = Emma var element = names.pop();
var element2 = names.pop(); //element = Emma
//element2 = Sophia var element2 = names.pop();
` //element2 = Sophia
```
### إدفع() ### إدفع()
يضيف عنصرًا واحدًا أو أكثر إلى نهاية الصفيف ويعود بالطول الجديد للمصفوفة. يضيف عنصرًا واحدًا أو أكثر إلى نهاية الصفيف ويعود بالطول الجديد للمصفوفة.
`var length = names.push('Tobias'); ```typescript
// names[] = ['Javier', 'Emma', 'John', 'Sophia', 'Emma', 'Tobias'] var length = names.push('Tobias');
// lenght = 6 // names[] = ['Javier', 'Emma', 'John', 'Sophia', 'Emma', 'Tobias']
var length2 = names.push('Jack','Lily'); // lenght = 6
// names[] = ['Javier', 'Emma', 'John', 'Sophia', 'Emma', 'Tobias','Jack','Lily'] var length2 = names.push('Jack','Lily');
// lenght2 = 8 // names[] = ['Javier', 'Emma', 'John', 'Sophia', 'Emma', 'Tobias','Jack','Lily']
` // lenght2 = 8
```
### عكس() ### عكس()
عكس ترتيب الصفيف وإرجاعها عكس ترتيب الصفيف وإرجاعها
`var reverseNames = names.reverse(); ```typescript
//reverseNames = ['Emma','Sophia','John','Emma','Javier'] var reverseNames = names.reverse();
` //reverseNames = ['Emma','Sophia','John','Emma','Javier']
```
[المزيد من الطرق والوصف في TutorialsPoint](https://www.tutorialspoint.com/typescript/typescript_arrays.htm) [المزيد من الطرق والوصف في TutorialsPoint](https://www.tutorialspoint.com/typescript/typescript_arrays.htm)

View File

@ -6,5 +6,6 @@ localeTitle: اكتب منطقي
`boolean` هي قيمة true / false الأساسية لجافا سكريبت. `boolean` هي قيمة true / false الأساسية لجافا سكريبت.
`let isDone: boolean = false; ```typescript
` let isDone: boolean = false;
```

View File

@ -11,17 +11,18 @@ localeTitle: تتضمن التعدادات
1. رقمية 1. رقمية
2. سلسلة القائم 2. سلسلة القائم
`// numeric enum ```typescript
enum NumericEnum { // numeric enum
numeric1 = 1, enum NumericEnum {
numeric2, numeric1 = 1,
numeric3, numeric2,
numeric4, numeric3,
} numeric4,
}
// string based enum
enum StringBasedEnum { // string based enum
Programming = "is fun", enum StringBasedEnum {
Pizza = "is good" Programming = "is fun",
} Pizza = "is good"
` }
```

View File

@ -6,11 +6,12 @@ localeTitle: ل .. من حلقة
`for..of` loop هي حلقة خاصة في TypeScript والتي يمكنك استخدامها للتكرار من خلال قيم الصفيف. `for..of` loop هي حلقة خاصة في TypeScript والتي يمكنك استخدامها للتكرار من خلال قيم الصفيف.
`let fruits = ['Apple', 'Banana', 'Orange']; ```typescript
let fruits = ['Apple', 'Banana', 'Orange'];
for (let fruit of fruits) {
console.log(fruit); for (let fruit of fruits) {
} console.log(fruit);
` }
```
سيكون الناتج الذي ستحصل عليه من الكود أعلاه هو "Apple" و "Banana" و "Orange". نظرًا لعدم تكرار هذا النوع من الحلقات من خلال المؤشرات ، فلن تحصل على "0" و "1" و "2". سيكون الناتج الذي ستحصل عليه من الكود أعلاه هو "Apple" و "Banana" و "Orange". نظرًا لعدم تكرار هذا النوع من الحلقات من خلال المؤشرات ، فلن تحصل على "0" و "1" و "2".

View File

@ -16,27 +16,29 @@ localeTitle: الأدوية
##### المهام ##### المهام
`function printMessage(arg: any): any { ```typescript
return arg; function printMessage(arg: any): any {
} return arg;
}
// typescript won't complain because the argument type and return type aren't being typed properly
const myMessage: string = printMessage(1); // typescript won't complain because the argument type and return type aren't being typed properly
` const myMessage: string = printMessage(1);
```
كما ترى من أعلاه ، فإن تمرير `any` نوع من الوسيطة في الدالة ، بالإضافة إلى نوع الإرجاع ، لا يعد مثاليًا حيث يتم فقد معلومات النوع في العملية. كما ترى من أعلاه ، فإن تمرير `any` نوع من الوسيطة في الدالة ، بالإضافة إلى نوع الإرجاع ، لا يعد مثاليًا حيث يتم فقد معلومات النوع في العملية.
`// updated example ```typescript
function printMessage<T>(arg: T): T { // updated example
return arg; function printMessage<T>(arg: T): T {
} return arg;
}
// typescript complains because the variable type and the return type of the function don't match
const myMessage: string = printMessage(1); // typescript complains because the variable type and the return type of the function don't match
const myMessage: string = printMessage(1);
// resolve the issue by making sure both types match each other
const myMessage: number = printMessage(1); // resolve the issue by making sure both types match each other
` const myMessage: number = printMessage(1);
```
إن تضمين `<T>` مع الدالة يخبر TypeScript أنه عام ، وأن تمرير ذلك كمرجع سيجعل TypeScript يعلم أن القيم المرتبطة به من نفس النوع. إن تضمين `<T>` مع الدالة يخبر TypeScript أنه عام ، وأن تمرير ذلك كمرجع سيجعل TypeScript يعلم أن القيم المرتبطة به من نفس النوع.

View File

@ -14,8 +14,9 @@ localeTitle: التركيب
سيقوم هذا الأمر بتثبيت حزمة TypeScript كاعتمادية في مشروعك باستخدام [`npm`](https://www.npmjs.com/) وهو مدير حزم شائع. سيقوم هذا الأمر بتثبيت حزمة TypeScript كاعتمادية في مشروعك باستخدام [`npm`](https://www.npmjs.com/) وهو مدير حزم شائع.
`npm i typescript ```bash
` npm i typescript
```
_ملاحظة:_ هناك [عدة خيارات](https://docs.npmjs.com/cli/install) `npm` حسب المكان الذي تريد تثبيت TypeScript فيه. _ملاحظة:_ هناك [عدة خيارات](https://docs.npmjs.com/cli/install) `npm` حسب المكان الذي تريد تثبيت TypeScript فيه.
@ -28,15 +29,17 @@ _ملاحظة:_ هناك [عدة خيارات](https://docs.npmjs.com/cli/instal
### تجميع ملف واحد لأسفل إلى جافا سكريبت ### تجميع ملف واحد لأسفل إلى جافا سكريبت
`tsc multiplication.ts ```bash
` tsc multiplication.ts
```
_إلى ملاحظة_ يمكنك تكوين عملية تجميع TypeScript هذه كبرنامج نصي npm مخصص في `package.json` الخاص بك. _إلى ملاحظة_ يمكنك تكوين عملية تجميع TypeScript هذه كبرنامج نصي npm مخصص في `package.json` الخاص بك.
### خيارات الإعداد ### خيارات الإعداد
`touch tsconfig.json ```bash
` touch tsconfig.json
```
هناك أيضًا خيار إنشاء ملف [`tsconfig.json`](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) يحدد ملفات الجذر وخيارات المترجم. هناك أيضًا خيار إنشاء ملف [`tsconfig.json`](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) يحدد ملفات الجذر وخيارات المترجم.
@ -52,32 +55,34 @@ _إلى ملاحظة_ يمكنك تكوين عملية تجميع TypeScript ه
> `multiplication.ts` > `multiplication.ts`
`let a: number = 10; ```typescript
let b: number = 2; let a: number = 10;
let b: number = 2;
function showProduct(first: number, second: number): void {
console.info("Mathematical! The result is " + first * second + "."); function showProduct(first: number, second: number): void {
} console.info("Mathematical! The result is " + first * second + ".");
}
showProduct(a, b);
showProduct(a, b);
// Mathematical! The result is 20.
` // Mathematical! The result is 20.
```
وبمجرد أن تنتهي من إنشاء `multiplication.ts` ، ويمكنني أن ترجمة ذلك الى جافا سكريبت باستخدام `tsc` القيادة التي تقف على ترجمة نسخة مطبوعة على الآلة الكاتبة. وبمجرد أن تنتهي من إنشاء `multiplication.ts` ، ويمكنني أن ترجمة ذلك الى جافا سكريبت باستخدام `tsc` القيادة التي تقف على ترجمة نسخة مطبوعة على الآلة الكاتبة.
> `multiplication.js` > `multiplication.js`
`var a = 10; ```javascript
var b = 2; var a = 10;
var b = 2;
function showProduct(first, second) {
console.info("Mathematical! The result is " + first * second + "."); function showProduct(first, second) {
} console.info("Mathematical! The result is " + first * second + ".");
}
showProduct(a, b);
showProduct(a, b);
// Mathematical! The result is 20.
` // Mathematical! The result is 20.
```
بام - لقد جمعت بنجاح TypeScript إلى JavaScript! بام - لقد جمعت بنجاح TypeScript إلى JavaScript!

View File

@ -18,5 +18,6 @@ TSLint عبارة عن أداة تحليل ثابتة قابلة للتوسعة
سيقوم هذا الأمر بتثبيت حزمة `TSLint` عالميًا باستخدام `npm` ، مدير حزم شائع. سيقوم هذا الأمر بتثبيت حزمة `TSLint` عالميًا باستخدام `npm` ، مدير حزم شائع.
`npm i -g tslint ```bash
` npm i -g tslint
```

View File

@ -8,19 +8,20 @@ localeTitle: أبدا اكتب
النوع `never` هو نوع فرعي من كل نوع ، ويمكن التنازل عنه. ومع ذلك ، لا يوجد نوع هو نوع فرعي أو يمكن التنازل عنه `never` (باستثناء أبداً نفسه). حتى أي شيء لا يمكن التنازل عنه أبداً. النوع `never` هو نوع فرعي من كل نوع ، ويمكن التنازل عنه. ومع ذلك ، لا يوجد نوع هو نوع فرعي أو يمكن التنازل عنه `never` (باستثناء أبداً نفسه). حتى أي شيء لا يمكن التنازل عنه أبداً.
`// Function returning never must have unreachable end point ```typescript
function error(message: string): never { // Function returning never must have unreachable end point
throw new Error(message); function error(message: string): never {
} throw new Error(message);
}
// Inferred return type is never
function fail() { // Inferred return type is never
return error("Something failed"); function fail() {
} return error("Something failed");
}
// Function returning never must have unreachable end point
function infiniteLoop(): never { // Function returning never must have unreachable end point
while (true) { function infiniteLoop(): never {
} while (true) {
} }
` }
```

View File

@ -6,13 +6,15 @@ localeTitle: نوع فارغ
في TypeScript ، يحتوي النوع الفارغ على القيم الخالية. Null هي قيم صالحة من كل نوع. في TypeScript ، يحتوي النوع الفارغ على القيم الخالية. Null هي قيم صالحة من كل نوع.
`let u: null = null; ```ts
` let u: null = null;
```
عند استخدام العلامة - علامة StrictNullChecks ، يتم تعيين null فقط إلى الفراغ ونوعها. عند استخدام العلامة - علامة StrictNullChecks ، يتم تعيين null فقط إلى الفراغ ونوعها.
`let s = "foo"; ```ts
s = null; // error, 'null' is not assignable to 'string' let s = "foo";
let sn: string | null = "bar"; s = null; // error, 'null' is not assignable to 'string'
sn = null; // ok let sn: string | null = "bar";
` sn = null; // ok
```

View File

@ -6,8 +6,9 @@ localeTitle: نوع الرقم
جميع الأرقام في TypeScript هي قيم النقطة العائمة. يدعم TypeScript القيم الحرفية الثنائية والثنائية من ES6. جميع الأرقام في TypeScript هي قيم النقطة العائمة. يدعم TypeScript القيم الحرفية الثنائية والثنائية من ES6.
`let decimal: number = 7; ```typescript
let hex: number = 0xf00d; let decimal: number = 7;
let binary: number = 0b0110; let hex: number = 0xf00d;
let octal: number = 0o531; let binary: number = 0b0110;
` let octal: number = 0o531;
```

View File

@ -6,9 +6,10 @@ localeTitle: نوع السلسلة
سلاسل يمكن أن تكون مكتوبة مع `''` علامات الاقتباس المفردة أو `""` علامات اقتباس مزدوجة. كن متسقًا مع شفرتك واختر نمطًا. سلاسل يمكن أن تكون مكتوبة مع `''` علامات الاقتباس المفردة أو `""` علامات اقتباس مزدوجة. كن متسقًا مع شفرتك واختر نمطًا.
`let dog: string = 'Fido'; ```typescript
let activity: string = "Playing Outside"; let dog: string = 'Fido';
` let activity: string = "Playing Outside";
```
يمكن كتابة السلاسل باستخدام حرفية القالب: يمكن كتابة السلاسل باستخدام حرفية القالب:
@ -23,29 +24,32 @@ localeTitle: نوع السلسلة
مع وظيفة الانقسام ، يمكنك تقسيم السلسلة الخاصة بك عند فاصل محدد. يمكنك تعيين رقم حد ، وهذا يعني عدد الانقسامات التي يتعين عليها فعلها. إرجاع السلسلة splitted في نوع صفيف. مع وظيفة الانقسام ، يمكنك تقسيم السلسلة الخاصة بك عند فاصل محدد. يمكنك تعيين رقم حد ، وهذا يعني عدد الانقسامات التي يتعين عليها فعلها. إرجاع السلسلة splitted في نوع صفيف.
`let names: string = 'Sarah,Lily,John,Paula,Harvey'; ```typescript
let array: string[] = names.split(','); let names: string = 'Sarah,Lily,John,Paula,Harvey';
//array = ['Sarah','Lily','John','Paula','Harvey'] let array: string[] = names.split(',');
let array2: string[] = names.split(',',2); //array = ['Sarah','Lily','John','Paula','Harvey']
//array2 = ['Sarah','Lily'] let array2: string[] = names.split(',',2);
` //array2 = ['Sarah','Lily']
```
### SUBSTR (startAt، طول) ### SUBSTR (startAt، طول)
تعود هذه الطريقة بسلسلة فرعية ، والتي `startAt` عند حرف `startAt` من السلسلة الأصلية ، ويكون طولها `length` . تعود هذه الطريقة بسلسلة فرعية ، والتي `startAt` عند حرف `startAt` من السلسلة الأصلية ، ويكون طولها `length` .
`let names: string = 'Harvey Specter'; ```typescript
let substr: string = names.substr(3,10); let names: string = 'Harvey Specter';
//substr = 'rvey Spect' let substr: string = names.substr(3,10);
` //substr = 'rvey Spect'
```
### فرعية (startAt، endAt) ### فرعية (startAt، endAt)
تشبه هذه الطريقة substr () ، ولكن لها معلمات مختلفة. المعلمة الثانية هي أيضًا فهرس حول السلسلة الأصلية ، وليس رقم طول. تشبه هذه الطريقة substr () ، ولكن لها معلمات مختلفة. المعلمة الثانية هي أيضًا فهرس حول السلسلة الأصلية ، وليس رقم طول.
`let names: string = 'Harvey Specter'; ```typescript
let substring: string = names.substring(3,10); let names: string = 'Harvey Specter';
//substring = 'rvey Spe' let substring: string = names.substring(3,10);
` //substring = 'rvey Spe'
```
[المزيد من الطرق والوصف في TutorialsPoint](https://www.tutorialspoint.com/typescript/typescript_strings.htm) [المزيد من الطرق والوصف في TutorialsPoint](https://www.tutorialspoint.com/typescript/typescript_strings.htm)

View File

@ -6,24 +6,26 @@ localeTitle: نوع المجموعة
التعبير عن مصفوفة يعرف فيها عدد محدد من عناصر الأنواع ، ولكن ليس هو نفسه. التعبير عن مصفوفة يعرف فيها عدد محدد من عناصر الأنواع ، ولكن ليس هو نفسه.
`let arr: [string, number]; ```typescript
let arr: [string, number];
// This is correct
arr = ['Hello', 7]; // This is correct
arr = ['Hello', 7];
//This is incorrect
arr = [7, 'Hello']; //This is incorrect
` arr = [7, 'Hello'];
```
عند الوصول إلى عنصر خارج المؤشرات المعروفة ، سيستخدم نوع الاتحاد: عند الوصول إلى عنصر خارج المؤشرات المعروفة ، سيستخدم نوع الاتحاد:
`arr[3] = 'World!' ```typescript
// OK, 'string' can be assigned to 'string | number' arr[3] = 'World!'
// OK, 'string' can be assigned to 'string | number'
// Error, 'boolean' is not a 'string | number'
arr[5] = false; // Error, 'boolean' is not a 'string | number'
// Error, 'boolean' is not a 'string | number' arr[5] = false;
` // Error, 'boolean' is not a 'string | number'
```
## الخصائص ## الخصائص
@ -33,12 +35,13 @@ localeTitle: نوع المجموعة
قال هذا العقار ، كم عنصر لديه عنصر. قال هذا العقار ، كم عنصر لديه عنصر.
`let tuple = []; //you can initialize it after the declaration too, not just the method above ```typescript
tuple[0] = 10; let tuple = []; //you can initialize it after the declaration too, not just the method above
tuple[1] = 'Mike'; tuple[0] = 10;
let number = tuple.length; tuple[1] = 'Mike';
//number = 2; let number = tuple.length;
` //number = 2;
```
## أساليب مدمجة ## أساليب مدمجة
@ -48,19 +51,21 @@ localeTitle: نوع المجموعة
يزيل العنصر الأخير من tuple. يزيل العنصر الأخير من tuple.
`var tuple = [10,'Emma',11,'Lily',12,'Mike Ross']; ```typescript
tuple.pop(); var tuple = [10,'Emma',11,'Lily',12,'Mike Ross'];
//tuple = [10,'Emma',11,'Lily',12,] tuple.pop();
//We popped 'Mike Ross' from the tuple //tuple = [10,'Emma',11,'Lily',12,]
` //We popped 'Mike Ross' from the tuple
```
### إدفع() ### إدفع()
يضيف عنصرًا إلى نهاية المجموعة. يضيف عنصرًا إلى نهاية المجموعة.
`var tuple = [10,'Emma',11,'Lily',12,'Mike Ross']; ```typescript
tuple.push('Rachel Zane'); var tuple = [10,'Emma',11,'Lily',12,'Mike Ross'];
//tuple = [10,'Emma',11,'Lily',12,'Mike Ross','Rachel Zane'] tuple.push('Rachel Zane');
` //tuple = [10,'Emma',11,'Lily',12,'Mike Ross','Rachel Zane']
```
[مزيد من المعلومات حول tuples على TutorialsPoint](https://www.tutorialspoint.com/typescript/typescript_tuples.htm) [مزيد من المعلومات حول tuples على TutorialsPoint](https://www.tutorialspoint.com/typescript/typescript_tuples.htm)

View File

@ -6,26 +6,29 @@ localeTitle: نوع غير معرف
في TypeScript ، نفس النوع الفارغ ، يكون للنوع غير المحدد قيم غير محددة. غير محددة هي قيم صالحة من كل نوع. في TypeScript ، نفس النوع الفارغ ، يكون للنوع غير المحدد قيم غير محددة. غير محددة هي قيم صالحة من كل نوع.
`let u: undefined = undefined; ```ts
` let u: undefined = undefined;
```
عند استخدام - علامة `--strictNullChecks` ، غير قابل `--strictNullChecks` فقط لإبطال ونوعها. عند استخدام - علامة `--strictNullChecks` ، غير قابل `--strictNullChecks` فقط لإبطال ونوعها.
`let s = "foo"; ```ts
s = null; // error, 'null' is not assignable to 'string' let s = "foo";
let sn: string | null = "bar"; s = null; // error, 'null' is not assignable to 'string'
sn = null; // ok let sn: string | null = "bar";
sn = null; // ok
sn = undefined; // error, 'undefined' is not assignable to 'string | null'
` sn = undefined; // error, 'undefined' is not assignable to 'string | null'
```
مع `--strictNullChecks` ، مقياس اختياري تلقائيا بإضافة `| undefined` : مع `--strictNullChecks` ، مقياس اختياري تلقائيا بإضافة `| undefined` :
`function f(x: number, y?: number) { ```ts
return x + (y || 0); function f(x: number, y?: number) {
} return x + (y || 0);
f(1, 2); }
f(1); f(1, 2);
f(1, undefined); f(1);
f(1, null); // error, 'null' is not assignable to 'number | undefined' f(1, undefined);
` f(1, null); // error, 'null' is not assignable to 'number | undefined'
```

View File

@ -7,7 +7,8 @@ localeTitle: نوع الفراغ
لا ينبغي أن تستخدم للمتغيرات ، واستخدام `null` أو `undefined` . لا ينبغي أن تستخدم للمتغيرات ، واستخدام `null` أو `undefined` .
ومع ذلك ، استخدمها للوظائف التي لا تعرض قيمة. ومع ذلك ، استخدمها للوظائف التي لا تعرض قيمة.
`const greeting(): void { ```typescript
alert('Hello, and Welcome to My Webpage!'); const greeting(): void {
} alert('Hello, and Welcome to My Webpage!');
` }
```

View File

@ -6,15 +6,17 @@ localeTitle: وزن الخط والنمط
يمكن كتابة خط الوزن على هيئة قيم نصية: يمكن كتابة خط الوزن على هيئة قيم نصية:
`font-weight: normal; ```
font-weight: bold; font-weight: normal;
` font-weight: bold;
```
أو كقيمة رقمية من `100` إلى `900` (بمضاعفات 100): أو كقيمة رقمية من `100` إلى `900` (بمضاعفات 100):
`font-weight: 400; /* equal to 'normal' above */ ```
font-weight: 700; /* equal to 'bold' above */ font-weight: 400; /* equal to 'normal' above */
` font-weight: 700; /* equal to 'bold' above */
```
القيمة العددية ووصفها المشترك القيمة العددية ووصفها المشترك
@ -24,6 +26,7 @@ localeTitle: وزن الخط والنمط
يمكن أيضًا تحديد وزن الخط بالنسبة إلى أصل أحد العناصر (إذا كان الخط يحتوي على أكثر من وزن): يمكن أيضًا تحديد وزن الخط بالنسبة إلى أصل أحد العناصر (إذا كان الخط يحتوي على أكثر من وزن):
`font-weight: lighter; ```
font-weight: bolder; font-weight: lighter;
` font-weight: bolder;
```

View File

@ -8,14 +8,15 @@ localeTitle: حجم النقطة
في نوع المعدن ، يشير حجم النقطة إلى ارتفاع الجسم المعدني الذي يتم صب شخصية الخط. في الخطوط الرقمية ، يتم استبدال الجسم المعدني بصندوق غير مرئي يعرف باسم _مربع em_ . كل حرف يناسب داخل مربع em أو مربع em. **حجم em للخط يساوي حجم النقطة.** في نوع المعدن ، يشير حجم النقطة إلى ارتفاع الجسم المعدني الذي يتم صب شخصية الخط. في الخطوط الرقمية ، يتم استبدال الجسم المعدني بصندوق غير مرئي يعرف باسم _مربع em_ . كل حرف يناسب داخل مربع em أو مربع em. **حجم em للخط يساوي حجم النقطة.**
`html{ ```css
font-size:16px; html{
} font-size:16px;
}
body{
font-size:1em; // 1em is equal to 16px body{
} font-size:1em; // 1em is equal to 16px
` }
```
كما يتم استخدام حجم النقطة لقياس المسافة بين السطور (خط الطول) وطول الخط وعناصر أخرى ، بغض النظر عن حجم الخط. كما يتم استخدام حجم النقطة لقياس المسافة بين السطور (خط الطول) وطول الخط وعناصر أخرى ، بغض النظر عن حجم الخط.
في الخطوط الرقمية ، **نقطة واحدة تساوي 1/72 من البوصة** . اثنا عشر نقطة تجعل واحدة بيكا. ستة بيكا تجعل بوصة واحدة. الطريقة الشائعة لتمثيل picas والنقاط هي كما يلي: في الخطوط الرقمية ، **نقطة واحدة تساوي 1/72 من البوصة** . اثنا عشر نقطة تجعل واحدة بيكا. ستة بيكا تجعل بوصة واحدة. الطريقة الشائعة لتمثيل picas والنقاط هي كما يلي:

View File

@ -10,14 +10,15 @@ localeTitle: من أين احصل على الخطوط
تتيح لك المواقع مثل Font Squirrel تنزيل ملفات الخطوط التي اخترتها. بمجرد الانتهاء من ذلك ، يجب عليك تحميلها على الخادم الذي يستضيف موقع الويب الخاص بك. لاستخدامها ، تحتاج بعد ذلك إلى إعلانها في ورقة أنماط CSS الخاصة بك ، مما يعني إخبار CSS الخاص بك أن تطلب من متصفح المستخدم عرضه. يتم عادةً إعداد خط باستخدام `@font-face` أعلى ورقة أنماط CSS. تتيح لك المواقع مثل Font Squirrel تنزيل ملفات الخطوط التي اخترتها. بمجرد الانتهاء من ذلك ، يجب عليك تحميلها على الخادم الذي يستضيف موقع الويب الخاص بك. لاستخدامها ، تحتاج بعد ذلك إلى إعلانها في ورقة أنماط CSS الخاصة بك ، مما يعني إخبار CSS الخاص بك أن تطلب من متصفح المستخدم عرضه. يتم عادةً إعداد خط باستخدام `@font-face` أعلى ورقة أنماط CSS.
`@font-face { ```css
font-family: "My Super Awesome Open Sans Font"; /* name that you will use later to apply the font */ @font-face {
src: url("/fontfolder/open-sans.woff"); /* path to the file */ font-family: "My Super Awesome Open Sans Font"; /* name that you will use later to apply the font */
} src: url("/fontfolder/open-sans.woff"); /* path to the file */
body { }
font-family: "My Super Awesome Open Sans Font"; body {
} font-family: "My Super Awesome Open Sans Font";
` }
```
لاحظ أنه يمكنك أيضًا تحديد تنسيق الخط وفقًا لتوافق المستعرض كما يلي. لاحظ أنه يمكنك أيضًا تحديد تنسيق الخط وفقًا لتوافق المستعرض كما يلي.
@ -33,21 +34,22 @@ localeTitle: من أين احصل على الخطوط
لاستخدام Google Fonts ، استعرض [الموقع](https://fonts.google.com/) للعثور على الخط الذي يناسب مشروعك. بمجرد اختيارك ، انقر فوق علامة زائد (+) الموجودة بجوار الخط. سيظهر شريط في أسفل الشاشة. انقر عليه. سيتم بعد ذلك منحك عدة أسطر من الشفرة. انسخ والصق سطر HTML في رأس ملف HTML الخاص بك فوق الملف الموجود جزء. ثم خذ CSS واستخدمه عند الضرورة في ورقة الأنماط. لاستخدام Google Fonts ، استعرض [الموقع](https://fonts.google.com/) للعثور على الخط الذي يناسب مشروعك. بمجرد اختيارك ، انقر فوق علامة زائد (+) الموجودة بجوار الخط. سيظهر شريط في أسفل الشاشة. انقر عليه. سيتم بعد ذلك منحك عدة أسطر من الشفرة. انسخ والصق سطر HTML في رأس ملف HTML الخاص بك فوق الملف الموجود جزء. ثم خذ CSS واستخدمه عند الضرورة في ورقة الأنماط.
` ```html
<html> <html>
<head> <head>
<link href="https://fonts.googleapis.com/css?family=Inconsolata" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Inconsolata" rel="stylesheet">
</head> </head>
<body> <body>
Some text. Some text.
</body> </body>
</html> </html>
` ```
`body{ ```css
font-family: "Inconsolata", monospace; body{
} font-family: "Inconsolata", monospace;
` }
```
انت انتهيت! لديك بنجاح خطوط جديدة لموقعك. انت انتهيت! لديك بنجاح خطوط جديدة لموقعك.

View File

@ -12,8 +12,9 @@ localeTitle: وحدات الماكرو
لبدء ماكرو ، في الوضع العادي ، اضغط على: لبدء ماكرو ، في الوضع العادي ، اضغط على:
`q<REGISTER LETTER> ```vim
` q<REGISTER LETTER>
```
مثال: `qq` يبدأ ماكرو في السجل `q` ، يبدأ `qs` الماكرو في التسجيل `s` مثال: `qq` يبدأ ماكرو في السجل `q` ، يبدأ `qs` الماكرو في التسجيل `s`

View File

@ -19,24 +19,25 @@ localeTitle: التنقل
باختصار: باختصار:
`h moves one character left ```vim
j moves one row down h moves one character left
k moves one row up j moves one row down
l moves one character right k moves one row up
l moves one character right
w moves to the beginning of the next word
b moves to the beginning of the previous word w moves to the beginning of the next word
e moves to the end of the current word b moves to the beginning of the previous word
e moves to the end of the current word
0 moves to the beginning of the current line
$ moves to the end of the current line 0 moves to the beginning of the current line
:n moves to line n (ex. :23 moves to line 23) can also use nG $ moves to the end of the current line
:n moves to line n (ex. :23 moves to line 23) can also use nG
ZZ moves to the center of the line your on
H moves to the top of the screen ZZ moves to the center of the line your on
M moves to the middle of the screen H moves to the top of the screen
L moves to the bottom of the screen M moves to the middle of the screen
L moves to the bottom of the screen
gg moves to the first line in the file
G moves to the last line in the file gg moves to the first line in the file
` G moves to the last line in the file
```

View File

@ -10,9 +10,10 @@ localeTitle: العوامل الممرضة
قم بتشغيل الأوامر التالية: قم بتشغيل الأوامر التالية:
`mkdir -p ~/.vim/autoload ~/.vim/bundle && \ ```
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim mkdir -p ~/.vim/autoload ~/.vim/bundle && \
` curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
```
* * * * * *
@ -20,15 +21,17 @@ localeTitle: العوامل الممرضة
أضف هذا الأمر إلى ملفك .vimrc: أضف هذا الأمر إلى ملفك .vimrc:
`execute pathogen#infect() ```
` execute pathogen#infect()
```
إذا لم يكن لديك أي ملف .vimrc ، اكتب `vim ~/.vimrc` وقم بلصق هذا: إذا لم يكن لديك أي ملف .vimrc ، اكتب `vim ~/.vimrc` وقم بلصق هذا:
`execute pathogen#infect() ```
syntax on execute pathogen#infect()
filetype plugin indent on syntax on
` filetype plugin indent on
```
هذا هو مثال أساسي جدا. في هذه اللحظة ، سيتم استخراج كل الإضافات إلى `~/.vim/bundle` وستتم إضافتها إلى _`runtimepath`_ هذا هو مثال أساسي جدا. في هذه اللحظة ، سيتم استخراج كل الإضافات إلى `~/.vim/bundle` وستتم إضافتها إلى _`runtimepath`_
@ -38,9 +41,10 @@ localeTitle: العوامل الممرضة
إذا كنت ترغب في تثبيت مكونات مثل NERDTree ، فقم ببساطة بتشغيل هذا: إذا كنت ترغب في تثبيت مكونات مثل NERDTree ، فقم ببساطة بتشغيل هذا:
`cd ~/.vim/bundle ```
git clone https://github.com/scrooloose/nerdtree cd ~/.vim/bundle
` git clone https://github.com/scrooloose/nerdtree
```
سيتم إضافته إلى \_ `runtimepath` . سيتم إضافته إلى \_ `runtimepath` .

View File

@ -32,28 +32,29 @@ localeTitle: صوت
وها هو JavaScript: وها هو JavaScript:
`window.SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition; ```javascript
window.SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition;
const span = document.querySelector('[data-js="varValue"]');
const main = document.querySelector('.main'); const span = document.querySelector('[data-js="varValue"]');
const loader = document.querySelector('.loader'); const main = document.querySelector('.main');
const loader = document.querySelector('.loader');
const recognition = new SpeechRecognition();
recognition.lang = 'en-US'; const recognition = new SpeechRecognition();
recognition.lang = 'en-US';
recognition.addEventListener('result', e => {
const transcript = Array.from(e.results) recognition.addEventListener('result', e => {
.map(result => result[0].transcript) const transcript = Array.from(e.results)
.map(result => result[0].transcript)
span.textContent = transcript;
loader.textContent = ''; span.textContent = transcript;
}); loader.textContent = '';
});
recognition.addEventListener('start', () => loader.textContent = 'Listening (enable your microphone)...');
recognition.addEventListener('start', () => loader.textContent = 'Listening (enable your microphone)...');
recognition.addEventListener('end', recognition.start);
recognition.start(); recognition.addEventListener('end', recognition.start);
` recognition.start();
```
### اليكسا ### اليكسا

View File

@ -8,25 +8,27 @@ localeTitle: لغة الترميز الموسعة (XML)
\## تركيب XML يشير بناء جملة XML إلى القواعد التي تحدد كيفية كتابة تطبيق XML. بناء جملة XML بشكل مستقيم جداً ، وهذا يجعل XML سهل التعلم. يجب أن تحتوي مستندات XML على عنصر أساسي واحد هو أصل كل العناصر الأخرى: \## تركيب XML يشير بناء جملة XML إلى القواعد التي تحدد كيفية كتابة تطبيق XML. بناء جملة XML بشكل مستقيم جداً ، وهذا يجعل XML سهل التعلم. يجب أن تحتوي مستندات XML على عنصر أساسي واحد هو أصل كل العناصر الأخرى:
`<root> ```
<child> <root>
<subchild>.....</subchild> <child>
</child> <subchild>.....</subchild>
</root> </child>
` </root>
```
#### يجب أن يكون XML عنصرًا أساسيًا #### يجب أن يكون XML عنصرًا أساسيًا
فوق بناء الجملة يظهر العنصر الجذر الذي هو ضروري أثناء إنشاء رمز XML. يمكن إظهار ذلك من خلال المثال: - فوق بناء الجملة يظهر العنصر الجذر الذي هو ضروري أثناء إنشاء رمز XML. يمكن إظهار ذلك من خلال المثال: -
`<?xml version="1.0" encoding="UTF-8"?> ```
<note> <?xml version="1.0" encoding="UTF-8"?>
<to>Tove</to> <note>
<from>Jani</from> <to>Tove</to>
<heading>Reminder</heading> <from>Jani</from>
<body>Don't forget me this weekend!</body> <heading>Reminder</heading>
</note> <body>Don't forget me this weekend!</body>
` </note>
```
في هذا المثال ، "note" هو العنصر الجذر. في هذا المثال ، "note" هو العنصر الجذر.